Part Number Hot Search : 
913M0 1C102 160CA 94C684 CP12C60 LM393A SM1145CS NL17S
Product Description
Full Text Search
 

To Download LAN9313-NZW Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  smsc lan9313/lan9313i revision 2.0 (02-14-13) datasheet datasheet product features lan9313/lan9313i three port 10/100 managed ethernet switch with mii highlights ? high performance and full featured 3 port switch with vlan, qos packet prioritization, rate limiting, igmp monitoring and management functions ? serial management via spi/i 2 c or smi ? unique virtual phy feature simplifies software development by mimicking t he multiple switch ports as a single port phy ? integrated ieee 1588 hardware time stamp unit target applications ? cable, satellite, and ip set-top boxes ? digital televisions ? digital video recorders ? voip/video phone systems ? home gateways ? test/measurement equipment ? industrial au tomation systems key benefits ? ethernet switch fabric 32k buffer ram 1k entry forwarding table port based ieee 802.1q vlan support (16 groups) C programmable ieee 802.1q tag insertion/removal ieee 802.1d spanning tree protocol support qos/cos packet prioritization C 4 dynamic qos queues per port C input priority determined by vlan tag, da lookup, tos, diffserv or port default value C programmable class of service map based on input priority C remapping of 802.1q priority field on per port basis C programmable rate limiting at the ingress/egress ports with random early discard, per port / priority igmp v1/v2/v3 monitoring for multicast packet filtering programmable filter by mac address ? switch management port mirroring/monitoring/sn iffing: ingress and/or egress traffic on any ports or port pairs fully compliant statistics (mib) gathering counters control registers configurable on-the-fly ? ports 2 internal 10/100 phys with hp auto-mdix support 1 mii - phy mode or mac mode fully compliant with ieee 802.3 standards 10base-t and 100base-tx support full and half duplex support full duplex flow control backpressure (forced collisi on) half duplex flow control automatic flow control based on programmable levels automatic 32-bit crc generation and checking 2k jumbo packet support programmable interframe gap, flow control pause value full transmit/receive statistics auto-negotiation automatic mdi/mdi-x loop-back mode ? serial management spi/i 2 c (slave) access to all internal registers miim (mdio) access to phy related registers smi (extended miim) access to all internal registers ? ieee 1588 hardware time stamp unit global 64-bit tunable clock master or slave mode per port time stamp on tx or rx of sync and delay_req packets per port, timestamp on gpio 64-bit timer comparator event generation (gpio or irq) ? other features general purpose timer serial eeprom interface (i 2 c master or microwire tm master) for non-managed configuration programmable gpios/leds ? single 3.3v power supply ? available in commercial & industrial temp. ranges downloaded from: http:///
order numbers: lan9313-nu for 128-pin, vtqfp lead-free rohs compliant package (0 to 70 c temp range) LAN9313-NZW for 128-pin, xvtqfp lead-free rohs compliant package (0 to 70 c temp range) lan9313i-nzw for 128-pin, xvtqfp lead-free rohs compliant package (-40 to 85 c temp range) lan9313-nu-tr for 128-pin, vtqfp lead-free rohs compliant package (0 to 70 c temp range) LAN9313-NZW-tr for 128-pin, xvtqfp lead-free rohs compliant package (0 to 70 c temp range) lan9313i-nzw-tr for 128-pin, xvtqfp lead-free rohs compliant package (-40 to 85 c temp range) tr indicates tape & reel option. this product meets the halogen maximum concentration values per iec61249-2-21 for rohs compliance and environmen tal information, please visit www.smsc.com/rohs three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 2 smsc lan9313/lan9313i datasheet copyright ? 2013 smsc or its subsidiaries. all rights reserved. circuit diagrams and other information relating to smsc produc ts are included as a means of illustrating typical applications. consequently, complete information sufficient for construction purposes is not necessarily given. although the information has been checked and is believed to b e accurate, no re sponsibility is assumed for inaccuracies. smsc reserves the right to make changes to specifications and produc t descriptions at any time without notice. contact your local sm sc sales office to obtain the latest specifications before placing your product order. the provision of this inform ation does not convey to the purchaser of the described semicond uctor devices any licenses under any patent rights or other intellectual property rights of smsc or others. all sales are expr essly conditional on your agreement to the te rms and conditions of the most recently dated version of smsc's standard terms of sale agreement dated before the date of your order (the "terms of sale agreement"). the pro duct may contain design defects or errors known as anomalies which may cause the product's functions to deviate from published specifications . anomaly sheets are availab le upon request. smsc products are not designed, intended, authorized or warranted for use in any life support or other applicati on where product failure could cause or contribute to personal injury or severe property damage. any and all such uses without prior written approval of an officer of smsc and furthe r testing and/or modification will be fully at the risk of the customer. copies of this document or other smsc literature, as well as the terms of sale agreement, may be obtai ned by visiting smscs website at h ttp://www.smsc.com. smsc is a registered trademark of standard microsystems corporation (smsc). product names and company names are the trademarks of their respective holders. the microchip name and logo, and the microchip logo are registered trademarks of microchip technolo gy incorporated in the u.s.a . and other countries. smsc disclaims and excludes any and all warrant ies, including without limi tation any and all implied warranties of merchantabil ity, fitness for a particular purpose, title, a nd against infringement and the like, and any and all warranties arising from any cou rse of dealing or usage of trade. in no event shall smsc be liable for any direct, incidental, indi rect, special, punitive, or cons equential damages; or for lost data, profits, savings or revenues of any kind; regardless of the form of action, whether based on contrac t; tort; negligence of smsc or others; strict liability; breach of wa rranty; or otherwise; whether or not any remedy of buyer is h eld to have failed of its essential purpose, and whether or not smsc has been advised of the possibility of such damages. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 3 revision 2.0 (02-14-13) datasheet table of contents chapter 1 preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.1 general terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.2 buffer types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.3 register nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 chapter 2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.1 system clocks/reset/pme controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.2 system interrupt controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.3 switch fabric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.4 ethernet phys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.5 phy management interface (pmi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.6 spi/i2c slave controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.7 smi slave controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.8 eeprom controller/loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.9 1588 time stamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.10 gpio/led controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.3 modes of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.1 mac mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.2 phy mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.3 management modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 chapter 3 pin description and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.1 pin diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.1.1 128-vtqfp pin diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.1.2 128-xvtqfp pin diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.2 pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 chapter 4 clocking, resets, and power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.1 clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.2 resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.2.1 chip-level resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.2.1.1 power-on reset (por) ...................................................................... .............................. .............................................................................. 44 4.2.1.2 nrst pin reset ............................................................................................ .............. .................................................................................... 45 4.2.2 multi-module resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.2.2.1 digital reset (digital_rst) .......................................................................... ................... ............................................................................ 45 4.2.3 single-module resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.2.3.1 port 2 phy reset........................................................................................ ................ .................................................................................... 46 4.2.3.2 port 1 phy reset........................................................................................ ................ .................................................................................... 46 4.2.3.3 virtual phy reset ......................................................................................... .............. .................................................................................... 46 4.2.4 configuration straps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.2.4.1 soft-straps .................................................................................................. .................................................................................................... 47 4.2.4.2 hard-straps............................................................................................ ......................................................................................................... 52 4.3 power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.3.1 port 1 & 2 phy power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 chapter 5 system interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.2 interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.2.1 1588 time stamp interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2.2 switch fabric interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2.3 ethernet phy interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 4 smsc lan9313/lan9313i datasheet 5.2.4 gpio interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.2.5 general purpose timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.2.6 software interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.2.7 device ready interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 chapter 6 switch fabric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.2 switch fabric csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.2.1 switch fabric csr writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.2.2 switch fabric csr reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.2.3 flow control en able logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.3 10/100 ethernet macs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.3.1 receive mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.3.1.1 receive counters ......................................................................................... .................................................................................................. 66 6.3.2 transmit mac. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.3.2.1 transmit counters ........................................................................................... ............ ................................................................................... 67 6.4 switch engine (swe) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.4.1 mac address lookup table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.4.1.1 learning/aging/migration ........................................ ................................................... ..... ................................................................................ 69 6.4.1.2 static entries................................................................................................. .................................................................................................. 69 6.4.1.3 multicast pruning ........................................................................................ ............... ..................................................................................... 69 6.4.1.4 address filtering ...................................................................................... ................. ...................................................................................... 69 6.4.1.5 spanning tree port state override........................................................ ............................... .......................................................................... 69 6.4.1.6 mac destination address lookup priority....................................................... .......................... ..................................................................... 69 6.4.1.7 host access ................................................................................................ ............. ....................................................................................... 69 6.4.2 forwarding rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 6.4.3 transmit priority queue selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.4.3.1 port default priority.......................................................................... ......................... ...................................................................................... 74 6.4.3.2 ip precedence based priority ..................................... ................................................... .... ............................................................................. 74 6.4.3.3 diffserv based priority..................................................................................... ............ .............................................................................. 74 6.4.3.4 vlan priority ......................................................................................... .................. ....................................................................................... 74 6.4.4 vlan support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 6.4.5 spanning tree support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 6.4.6 ingress flow metering and coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 6.4.6.1 ingress flow calculation............................................................................... ................. ................................................................................. 77 6.4.7 broadcast storm control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.4.8 ipv4 igmp support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.4.9 port mirroring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6.4.10 host cpu port special tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6.4.10.1 packets from the host cpu ............................................................................. ................. .............................................................................. 80 6.4.10.2 packets to the host cpu ...................................................................................... .......... ................................................................................ 81 6.4.11 counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.5 buffer manager (bm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.5.1 packet buffer alloca tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.5.1.1 buffer limits and flow control levels ............................................. ...................................... ......................................................................... 81 6.5.2 random early discard (red). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.5.3 transmit queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.5.4 transmit priority queue servicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.5.5 egress rate limiting (leaky bucket) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.5.6 adding, removing, and changing vlan tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 6.5.7 counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 6.6 switch fabric interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 chapter 7 ethernet phys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.1.1 phy addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.2 port 1 & 2 phys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.2.1 100base-tx transmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 7.2.1.1 mii mac interface .................................................................................. ..................... .................................................................................... 89 7.2.1.2 4b/5b encoder.............................................................................................. .................................................................................................. 89 7.2.1.3 scrambler and piso ........................................... ................................................... ........ ................................................................................. 91 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 5 revision 2.0 (02-14-13) datasheet 7.2.1.4 nrzi and mlt-3 encoding ........................................ ................................................... ...... ............................................................................ 91 7.2.1.5 100m transmit driver ............................................. ................................................... .... ................................................................................. 91 7.2.1.6 100m phase lock loop (pll) .......................................... ................................................... . .......................................................................... 91 7.2.2 100base-tx receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7.2.2.1 a/d converter .......................................................................................... ................. ...................................................................................... 92 7.2.2.2 dsp: equalizer, blw correction and clock/data recovery .............................. .................................... ........................................................ 92 7.2.2.3 nrzi and mlt-3 decoding ......................................... ................................................... ..... ............................................................................ 93 7.2.2.4 descrambler and sipo ............................................................................ ........................ ............................................................................... 93 7.2.2.5 5b/4b decoding .................................................................................. ........................ .................................................................................... 93 7.2.2.6 receiver errors ........................................................................................... .................................................................................................... 93 7.2.2.7 mii mac interface .................................................................................. ..................... .................................................................................... 93 7.2.3 10base-t transmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.2.3.1 mii mac interface .................................................................................. ..................... .................................................................................... 94 7.2.3.2 10m tx driver and pll .............................................. ................................................... .. ............................................................................... 94 7.2.4 10base-t receive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 7.2.4.1 filter and squelch ......................................................................................... ............. ..................................................................................... 94 7.2.4.2 10m rx and pll................................................ ................................................... ....... ................................................................................... 94 7.2.4.3 mii mac interface .................................................................................. ..................... .................................................................................... 95 7.2.4.4 jabber detection......................................... ................................................... ............ ..................................................................................... 95 7.2.5 phy auto-negotiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.2.5.1 phy pause flow control ............................................................................ ...................... .............................................................................. 97 7.2.5.2 parallel detection............................................................................................. ......... ...................................................................................... 97 7.2.5.3 restarting auto-negotiation................................................................... .......................... ............................................................................... 97 7.2.5.4 disabling auto-negotiation ......................................................................... ..................... ............................................................................... 97 7.2.5.5 half vs. full-duplex ......................................................................................... ........... .................................................................................... 98 7.2.6 hp auto-mdix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.2.7 mii mac interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 7.2.8 phy management control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.2.8.1 phy interrupts .................................................................................... ...................... ...................................................................................... 99 7.2.9 phy power-down modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 7.2.9.1 phy general power-down ...................................................................... ............................ ......................................................................... 100 7.2.9.2 phy energy detect power-down ....................................................................... ..................... ..................................................................... 100 7.2.10 phy resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.2.10.1 phy software reset via reset_ctl..................................................................... .................. ................................................................... 100 7.2.10.2 phy software reset via phy_basic_ctrl_x .............................................. .................................. ........................................................... 100 7.2.10.3 phy power-down reset.................................................................................. ................. ............................................................................ 101 7.2.11 leds. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.2.12 required ethernet magnetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.3 virtual phy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.3.1 virtual phy auto-negotiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.3.1.1 parallel detection............................................................................................. ......... .................................................................................... 102 7.3.1.2 disabling auto-negotiation ......................................................................... ..................... ............................................................................. 102 7.3.1.3 virtual phy pause flow control ................................................................. ......................... ......................................................................... 103 7.3.2 virtual phy in mac modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.3.2.1 full-duplex flow control............................................................................. ................... ............................................................................... 103 7.3.3 virtual phy resets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.3.3.1 virtual phy software reset via reset_ctl ................................................. ............................... .............................................................. 103 7.3.3.2 virtual phy software reset via vphy_basic_ctrl ............................... ........................................... ....................................................... 104 chapter 8 serial management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 8.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 8.2 i2c/microwire master eeprom controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5 8.2.1 eeprom controller oper ation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 8.2.2 i2c eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.2.2.1 i2c protocol overview ........................................................................................ .......................................................................................... 108 8.2.2.2 i2c eeprom device addressing....................................................................... ..................... ..................................................................... 109 8.2.2.3 i2c eeprom byte read .................................................................................... .......................................................................................... 109 8.2.2.4 i2c eeprom sequential byte reads .......................................... .............................................. .................................................................. 110 8.2.2.5 i2c eeprom byte writes ............................................................................... ............................................................................................. 111 8.2.3 microwire eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 8.2.3.1 microwire master commands ....................................................................... ........................ ........................................................................ 112 8.2.3.2 erase (erase location) ............................................................................ ...................... ............................................................................ 113 8.2.3.3 eral (erase all)......................................................................................... ............... ................................................................................... 114 8.2.3.4 ewds (erase/write disable) ................................................................. ............................. .......................................................................... 114 8.2.3.5 ewen (erase/write enable)...................................... ................................................... ...... .......................................................................... 115 8.2.3.6 read (read location) ............................................................................ ..................................................................................................... 115 8.2.3.7 write (write location) ................................................................. ................................. .............................................................................. 116 8.2.3.8 wral (write all)......................................................................................... ............... ................................................................................... 116 8.2.4 eeprom loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 8.2.4.1 eeprom loader operation ....................................... ................................................... ....... ........................................................................ 117 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 6 smsc lan9313/lan9313i datasheet 8.2.4.2 eeprom valid flag ............................................................................................. .......... .............................................................................. 119 8.2.4.3 mac address........................................................................................... .................. ................................................................................... 119 8.2.4.4 soft-straps .................................................................................................. .................................................................................................. 119 8.2.4.4.1 phy registers synchron ization ......................................................................................... ......119 8.2.4.4.2 virtual phy registers synchronization................................................................................. ...120 8.2.4.4.3 led and manual flow control register sy nchronization ........................................................120 8.2.4.5 register data ........................................................................................... ................ ..................................................................................... 120 8.2.4.6 eeprom loader finished wait-state...................................... ................................................. ................................................................... 121 8.2.4.7 reset sequence and eeprom loader...................................... .................................................. ................................................................ 121 8.3 spi/i2c slave controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 8.4 spi slave operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 8.4.1 spi read sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 8.4.1.1 spi read polling for reset complete.................................................... ................................. ...................................................................... 124 8.4.2 spi write sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 8.5 i2c slave operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 8.5.1 i2c slave command format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 8.5.2 i2c slave read sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 8.5.2.1 i2c slave read polling for reset complete ................................................. .............................. .................................................................. 127 8.5.3 i2c slave write sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 chapter 9 mii management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 9.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 9.2 smi slave controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 9.2.1 read sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 9.2.1.1 smi read polling for reset co mplete ...... ........... .......... ........... .................... ........... ................ ..................................................................... 130 9.2.2 write sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.3 phy management interface (pmi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.3.1 eeprom loader phy register access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.4 mii mode multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 9.4.1 mac mode unmanaged . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 9.4.2 mac mode smi managed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 9.4.3 mac mode i2c/spi managed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 9.4.4 phy mode unmanaged . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9.4.5 phy mode smi managed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 9.4.6 phy mode i2c/spi managed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 chapter 10 ieee 1588 hardware time stamp unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10.1.1 ieee 1588 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10.1.2 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 10.2 ieee 1588 time stamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.2.1 capture locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 10.2.2 ptp message detectio n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 10.3 ieee 1588 clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 10.4 ieee 1588 clock/events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 10.5 ieee 1588 gpios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.6 ieee 1588 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 chapter 11 general purpose timer & free-running clock. . . . . . . . . . . . . . . . . . . . . . . . 145 11.1 general purpose timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 11.2 free-running clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 chapter 12 gpio/led controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.1 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.2 gpio operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 12.2.1 gpio ieee 1588 timestamping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.2.1.1 ieee 1588 gpio inputs ......................................................................... ....................................................................................................... 147 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 7 revision 2.0 (02-14-13) datasheet 12.2.1.2 ieee 1588 gpio outputs ........................................................................ ..................................................................................................... 147 12.2.2 gpio interr upts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 12.2.2.1 gpio interrupt polarity........................................................................ ........................ .................................................................................. 147 12.2.2.2 ieee 1588 gpio interrupts............................................................ .................................. ............................................................................. 148 12.3 led operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 chapter 13 register descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 13.1 system control and status registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 13.1.1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 13.1.1.1 interrupt configuration register (irq_cfg) ......................................... .................................... ................................................................... 155 13.1.1.2 interrupt status register (int_sts)........................................................... .................................................................................................. 157 13.1.1.3 interrupt enable register (int_en).................................................... ................................. ......................................................................... 158 13.1.2 gpio/led. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 13.1.2.1 general purpose i/o configuration register (gpio_cfg) ..................... ............................................. ........................................................ 159 13.1.2.2 general purpose i/o data & direction register (gpio_data_dir) ........... ............................................... ................................................. 161 13.1.2.3 general purpose i/o interrupt status and enable register (gpio_ int_sts_en)............................................. ......................................... 162 13.1.2.4 led configuration register (led_cfg) .................................................... ............................... ................................................................... 163 13.1.3 eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 13.1.3.1 eeprom command register (e2p_cmd) ........................................ .............................................. ............................................................ 164 13.1.3.2 eeprom data register (e2p_data)................................................... ..................................... .................................................................. 167 13.1.4 ieee 1588 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 13.1.4.1 port x 1588 clock high-dword receive capture register (1588_clock_hi_ rx_capture_x) ..................................... ..................... 168 13.1.4.2 port x 1588 clock low-dword receive capture register (1588_clock_lo_rx_capture_x) ...................................... .................... 169 13.1.4.3 port x 1588 sequence id, source uuid high-word receive ca pture register (1588_seq_id_src_uuid_hi_rx_capture_x)..... 170 13.1.4.4 port x 1588 source uuid low-dword receive capture register (1588_src_uuid_lo_rx_capture_x)...................... ....... ........... 171 13.1.4.5 port x 1588 clock high-dword transmit capture register (1588_clock_hi_tx_capture_x)........................ ............ ...................... 172 13.1.4.6 port x 1588 clock low-dword transmit capture register (1588_clock_lo_tx_capture_x) ........................ ............. .................... 173 13.1.4.7 port x 1588 sequence id, source uuid high-word transmit capture register (1588_seq_id_src_uuid_hi_tx_capture_x) .... 174 13.1.4.8 port x 1588 source uuid low-dword transmit capture register (1588_src_uuid_lo_tx_capture_x) ............... ............. ........... 175 13.1.4.9 gpio 8 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_8)...................... ..................... ....................... 176 13.1.4.10 gpio 8 1588 clock low-dword capture register (1588_clock_lo_capture_gpio_8) ........................ ................... ...................... 177 13.1.4.11 gpio 9 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_9)..................... ..................... ........................ 178 13.1.4.12 gpio 9 1588 clock low-dword capture register (1588_clock_lo_capture_gpio_9) ........................ ................... ...................... 179 13.1.4.13 1588 clock high-dword register (1588_clock_hi)................................. ....................................... ....................................................... 180 13.1.4.14 1588 clock low-dword register (1588_clock_lo) .................................. ....................................... ..................................................... 181 13.1.4.15 1588 clock addend register (1588_clock_addend) ................................... ..................................... ..................................................... 182 13.1.4.16 1588 clock target high-dword register (1588_clock_target_hi).......................... ................................ ......................................... 183 13.1.4.17 1588 clock target low-dword register (1588_clock _target_lo) ................................................ ........... ....................................... 184 13.1.4.18 1588 clock target reload high-dword register (158 8_clock_target_reload_hi) ............................................ ......................... 185 13.1.4.19 1588 clock target reload/add low-dword register (1 588_clock_target_reload_lo)......................................... ..................... 186 13.1.4.20 1588 auxiliary mac address high-word register (1588_aux_mac_hi) .............................. ......................... ......................................... 187 13.1.4.21 1588 auxiliary mac address low-dword register (1588_aux_mac_lo) ........................... ............................ ...................................... 188 13.1.4.22 1588 configuration register (1588_config)............................... .............................................. ................................................................. 189 13.1.4.23 1588 interrupt status and enable register (1588_int_sts_en).............................. ............................. ..................................................... 193 13.1.4.24 1588 command register (1588_cmd) ........................................ .............................................. .................................................................. 195 13.1.5 switch fabric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 13.1.5.1 port 1 manual flow control register (manual_fc_1)............................... ....................................... ......................................................... 196 13.1.5.2 port 2 manual flow control register (manual_fc_2)............................... ....................................... ......................................................... 198 13.1.5.3 port 0(external mii) manual flow control register (manual_fc_mii) ......................... ............................. ................................................ 200 13.1.5.4 switch fabric csr interface data register (switch_csr_data) ...................... ...................................... ............................................... 202 13.1.5.5 switch fabric csr interface command register (switch_csr_cmd) ............................... ........................... ......................................... 203 13.1.5.6 switch fabric mac address high register (switch_ mac_addrh) ...... .......... ........... .......... ........................ ........................................... 205 13.1.5.7 switch fabric mac address low register (switch_ mac_addrl) ....... .......... ........... .......... ........................ ........................................... 206 13.1.5.8 switch fabric csr interface direct data register (switch_csr_direct_data) ............ .................................. ................................... 208 13.1.6 phy management interface (pmi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 13.1.6.1 phy management interface data register (pmi_data) ........................................ .............................. ....................................................... 211 13.1.6.2 phy management interface access register (pmi_access) ................................. ................................. .................................................. 212 13.1.7 virtual phy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 13.1.7.1 virtual phy basic control register (vphy_basic_ctrl) ............................... .................................... ...................................................... 214 13.1.7.2 virtual phy basic status register (vphy_basic_status)............ ...................................................... .................................................... 216 13.1.7.3 virtual phy identification msb register (vphy_id_msb) .......................... ........................................ ........................................................ 218 13.1.7.4 virtual phy identification lsb register (vphy_id_lsb) .................. ................................................ .......................................................... 219 13.1.7.5 virtual phy auto-negotiation advertisement register (vphy_an_a dv)...................................................... .............................................. 220 13.1.7.6 virtual phy auto-negotiation link partner base page ab ility register (vphy_an_lp_base_ability) ......................... ......................... 222 13.1.7.7 virtual phy auto-negotiation expansion register (vphy_an_exp) .......... ................................................ ................................................ 225 13.1.7.8 virtual phy special control/status register (vphy_special_co ntrol_status) .............................................. ................................ 226 13.1.8 miscellaneous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 13.1.8.1 chip id and revision (id_rev).......................................................................... ................ .......................................................................... 228 13.1.8.2 byte order test register (byte_test) .................................................... ............................... ................................................................... 229 13.1.8.3 hardware configuration register (hw_cfg)............................................................... ................ ................................................................ 230 13.1.8.4 general purpose timer configuration register (gpt _cfg) ....................................................................................................................... 231 13.1.8.5 general purpose timer count register (gpt_cnt) ................................... ...................................... .......................................................... 232 13.1.8.6 free running 25mhz counter register (free_run)......................................... ................................ ........................................................ 233 13.1.8.7 reset control register (reset_ctl) .................................................... ................................. .................................................................... 234 13.2 ethernet phy control and status registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 8 smsc lan9313/lan9313i datasheet 13.2.1 virtual phy registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 13.2.2 port 1 & 2 phy registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 13.2.2.1 port x phy basic control register (phy_basic_control_x) ........... ..................................................... ................................................ 237 13.2.2.2 port x phy basic status register (phy_basic_status_x) ........ .......................................................... ................................................... 239 13.2.2.3 port x phy identification msb register (phy_id_msb_x)............. ..................................................... ........................................................ 241 13.2.2.4 port x phy identification lsb register (phy_id_lsb_x).......................... ........................................ .......................................................... 242 13.2.2.5 port x phy auto-negotiation advertisement register (phy_an_adv_x) ......................... ............................. ............................................. 243 13.2.2.6 port x phy auto-negotiation link partner base page ability register (phy_an_lp_base_ability_x) .................... ..... ........................ 246 13.2.2.7 port x phy auto-negotiation expansion register (phy_an_exp_x) .......................... ................................ ............................................... 248 13.2.2.8 port x phy mode control/status register (phy_mode_control_stat us_x).................................................... ................................. 249 13.2.2.9 port x phy special modes register (phy_special_modes_x) ............ .................................................... .............................................. 250 13.2.2.10 port x phy special control/status indication register (phy_spe cial_control_stat_ind_x) ................................ .......................... 252 13.2.2.11 port x phy interrupt source flags register (phy _interrupt_source_x)... ........... .......... ........... ................ ........................................ 254 13.2.2.12 port x phy interrupt mask regi ster (phy_interrupt_mask_x ) .......... .......... ........... .......... ........... ......... ............................................... 255 13.2.2.13 port x phy special control/status register (phy_special_control_ status_x)............................................. ................................. 256 13.3 switch fabric control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 13.3.1 general switch csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 13.3.1.1 switch device id register (sw_dev_id) .................................................... .............................. .................................................................. 268 13.3.1.2 switch reset register (sw_reset) ........................................................... ............................ .................................................................... 269 13.3.1.3 switch global interrupt mask register (sw_imr)............................. ............................................ ............................................................... 270 13.3.1.4 switch global interrupt pending register (sw_ipr).......................... ............................................ .............................................................. 271 13.3.2 switch port 0, port 1, and port 2 csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 13.3.2.1 port x mac version id register (mac_ver_id_x) ........................................ .................................. ........................................................... 272 13.3.2.2 port x mac receive configuration register (mac_rx_cfg_x) ................. .............................................. .................................................. 273 13.3.2.3 port x mac receive undersize count register (mac_rx_undsze_cnt_x) .................................... .................. ..................................... 274 13.3.2.4 port x mac receive 64 byte count register (mac_rx_64_cnt_x).................. .......................................... .............................................. 275 13.3.2.5 port x mac receive 65 to 127 byte count register (mac_rx_65_to_1 27_cnt_x).............................................. .................................. 276 13.3.2.6 port x mac receive 128 to 255 byte count register (mac_rx_128_to_255_cnt_x)............................ ................ ................................ 277 13.3.2.7 port x mac receive 256 to 511 byte count register (mac_rx_256_to_511_cnt_x)............................ ................ ................................ 278 13.3.2.8 port x mac receive 512 to 1023 byte count register (mac_rx_512_to_1023_cnt_x).......................................... .............................. 279 13.3.2.9 port x mac receive 1024 to max byte count register (mac_rx_1024_to_max_cnt_x) ................................ .......... ........................... 280 13.3.2.10 port x mac receive oversize count register (mac_rx_ovrsze_cnt_x) ................................... ................... ....................................... 281 13.3.2.11 port x mac receive ok count register (mac_rx_pktok_cnt_x)....................... ...................................... ............................................ 282 13.3.2.12 port x mac receive crc error count register (mac_rx_crcerr_cnt_x).................................. ................... ..................................... 283 13.3.2.13 port x mac receive multicast count register (mac_ rx_mulcst_cnt_x) ................................................ ..... ........................................ 284 13.3.2.14 port x mac receive broadcast count register (ma c_rx_brdcst_cnt_x) ...... .......... ........... .......... ................ ...................................... 285 13.3.2.15 port x mac receive pause frame count register (mac_rx_pause_cnt_x) ... ................................................. .................................... 286 13.3.2.16 port x mac receive fragment error count register (mac_rx_frag_cnt_x)................................ .................. ...................................... 287 13.3.2.17 port x mac receive jabber error count register (ma c_rx_jabb_cnt_x) .............................................. ...... ......................................... 288 13.3.2.18 port x mac receive alignment error count register (mac_rx_align_cnt_x) .... ............................................ ...................................... 289 13.3.2.19 port x mac receive packet length count register (mac_rx_pktlen_cnt_x) ........................... ...................... .................................... 290 13.3.2.20 port x mac receive good packet length count register (mac_rx_goodpk tlen_cnt_x) ........................................ ........................ 291 13.3.2.21 port x mac receive symbol error count register (mac_rx_symbol_cnt_x) ............................................... ... .................................... 292 13.3.2.22 port x mac receive control frame count register (mac_rx_ctlfrm_cnt_x) .... ............................................. ................................... 293 13.3.2.23 port x mac transmit configuration register (mac_tx_cfg_x) ........... .................................................. ................................................... 294 13.3.2.24 port x mac transmit flow control settings register (mac_tx_fc_settings_x ) ............................................. ..................................... 295 13.3.2.25 port x mac transmit deferred count register (mac_tx_defer_cnt_x) .. .................................................... ......................................... 296 13.3.2.26 port x mac transmit pause count register (mac_tx_ pause_cnt_x) ................................................ ......... .......................................... 297 13.3.2.27 port x mac transmit ok count register (mac_tx_pktok_cnt_x) ................................... ......................... ............................................ 298 13.3.2.28 port x mac transmit 64 byte count register (mac_tx_64_cnt_x) ............................... ........................... ............................................... 299 13.3.2.29 port x mac transmit 65 to 127 byte count register (mac_tx_65_to_127_cnt_x) ........................... ................. ................................... 300 13.3.2.30 port x mac transmit 128 to 255 byte count regist er (mac_tx_128_to_255_cnt_x) .......................................... ................................. 301 13.3.2.31 port x mac transmit 256 to 511 byte count regist er (mac_tx_256_to_511_cnt_x) .......................................... ................................. 302 13.3.2.32 port x mac transmit 512 to 1023 byte count register (mac_tx_512_to_1023_cnt_x) ........................ ................ ............................... 303 13.3.2.33 port x mac transmit 1024 to max byte count register (mac_tx_1024_to_max_cnt_x)........................................ ............................. 304 13.3.2.34 port x mac transmit undersize count register (mac_tx_undsze_cnt_x) ............................... ..................... ...................................... 305 13.3.2.35 port x mac transmit packet length count register (mac_tx_pktle n_cnt_x) ................................................ .................................... 306 13.3.2.36 port x mac transmit broadcast count register (mac_tx_brdcst_cnt_x) ........................... ......................... ...................................... 307 13.3.2.37 port x mac transmit multicast count register (mac_tx_mulcst_cnt_x) .................................................... ........................................ 308 13.3.2.38 port x mac transmit late collision count register (mac_tx_latecol_cnt_x) . .......... ........... .......... ........ ...... ..................................... 309 13.3.2.39 port x mac transmit excessive collision count regist er (mac_tx_exccol_cnt_x)....... .......... ........... ........ ...... .................................. 310 13.3.2.40 port x mac transmit single collision count register (mac_tx_snglecol_cnt_ x) .......... ........... ................ ...... .................................. 311 13.3.2.41 port x mac transmit multiple collision count regist er (mac_tx_multicol_cnt_x) .... ........... .......... ................ ................................... 312 13.3.2.42 port x mac transmit total collision count register (mac_tx_totalcol_cnt_x)......................... ................... .................................... 313 13.3.2.43 port x mac interrupt mask register (mac_imr_x) ........................ ................................................ ............................................................. 314 13.3.2.44 port x mac interrupt pending register (mac_ipr_x) .......................... ........................................... ............................................................ 315 13.3.3 switch engine csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 13.3.3.1 switch engine alr command register (swe_alr_cmd) ........................ ............................................... ................................................. 316 13.3.3.2 switch engine alr write data 0 register (swe_alr_wr_dat_0) ................ ............................................. ............................................. 317 13.3.3.3 switch engine alr write data 1 register (swe_alr_wr_dat_1) ................ ............................................. ............................................. 318 13.3.3.4 switch engine alr read data 0 register (swe_alr_rd_dat_0)........... ................................................... ............................................. 320 13.3.3.5 switch engine alr read data 1 register (swe_alr_rd_dat_1)........... ................................................... ............................................. 321 13.3.3.6 switch engine alr command status register (swe_alr_cmd_sts) ............................................................ ........................................ 323 13.3.3.7 switch engine alr configuration register (swe_alr_cfg) ............................ ..................................... ................................................... 324 13.3.3.8 switch engine vlan command register (swe_vlan_cmd)................................. .................................... ............................................... 325 13.3.3.9 switch engine vlan write data register (swe_vlan_wr_data)........ ...................................................... ............................................ 326 13.3.3.10 switch engine vlan read data register (swe_vlan_rd_data) .................... .......................................... ............................................ 327 13.3.3.11 switch engine vlan command status register (swe_vlan_cmd_sts) ....................... .................................. ...................................... 328 13.3.3.12 switch engine diffserv table command register (swe_diffserv_tbl_cfg) .................................................. ............................... 329 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 9 revision 2.0 (02-14-13) datasheet 13.3.3.13 switch engine diffserv table write data register (swe_diffserv_tbl_wr _data) ........................................... ........................... 330 13.3.3.14 switch engine diffserv table read data register (swe_diffserv_tbl_rd_da ta) ............................................ ........................... 331 13.3.3.15 switch engine diffserv table command status register (swe_diffser v_tbl_cmd_sts) ....................................... ..................... 332 13.3.3.16 switch engine global ingress configuration register (swe_globa l_ingrss_cfg)........................................... .................................. 333 13.3.3.17 switch engine port ingress configuration register (swe_port_i ngrss_cfg) ............................................... ...................................... 335 13.3.3.18 switch engine admit only vlan register (swe_admt_only_vlan)................ ........................................... .......................................... 336 13.3.3.19 switch engine port state register (swe_port_state)................. ................................................... ....................................................... 337 13.3.3.20 switch engine priority to queue register (swe_pri_to_que) ................................ ............................. ................................................... 338 13.3.3.21 switch engine port mirroring register (swe_port_mirror)............................. .................................. ................................................... 339 13.3.3.22 switch engine ingress port type register (swe_ingrss_port_typ) .. ...................................................... ........................................... 340 13.3.3.23 switch engine broadcast throttling register (swe_bcst_throt) .......... ................................................ ................................................ 341 13.3.3.24 switch engine admit non member register (swe_admt_n_member)...... ..................................................... ........................................ 342 13.3.3.25 switch engine ingress rate configuration register (swe_ingrss_rate_cfg) ............................................... ..................................... 343 13.3.3.26 switch engine ingress rate command register (swe_ingrss_rate_cmd)........................... .......................... .................................... 344 13.3.3.26.1ingress rate table registers ........................................................................................ .........345 13.3.3.27 switch engine ingress rate command status register (swe_ingrss_rate_cmd_sts) .................. ........................ .......................... 346 13.3.3.28 switch engine ingress rate write data register (swe_ingrss_rate_ wr_data).............................................. ................................. 347 13.3.3.29 switch engine ingress rate read data register (swe_ingrss_rate_rd_data ) ............................................... ................................ 348 13.3.3.30 switch engine port 0 ingress filtered count register (swe_filtered_ cnt_mii) ........................................... ....................................... 349 13.3.3.31 switch engine port 1 ingress filtered count register (swe_filtered_ cnt_1) ............................................. ........................................ 350 13.3.3.32 switch engine port 2 ingress filtered count register (swe_filtered_ cnt_2) ............................................. ........................................ 351 13.3.3.33 switch engine port 0 ingress vlan priority regeneration table register (swe_ingrss_regen_tbl_mii) .............. ....... ................... 352 13.3.3.34 switch engine port 1 ingress vlan priority regeneration table register (swe_ingrss_regen_tbl_1) ............... ........ .................... 353 13.3.3.35 switch engine port 2 ingress vlan priority regeneration table register (swe_ingrss_regen_tbl_2) ............... ........ .................... 354 13.3.3.36 switch engine port 0 learn discard count register (swe_lrn_discrd_cnt_mii) ..................... ....................... ................................... 355 13.3.3.37 switch engine port 1 learn discard count register (swe_lrn_discrd_cnt_1) ..................... ......................... .................................... 356 13.3.3.38 switch engine port 2 learn discard count register (swe_lrn_discrd_cnt_2) ..................... ......................... .................................... 357 13.3.3.39 switch engine interrupt mask register (swe_imr)........................................ ............................... .............................................................. 358 13.3.3.40 switch engine interrupt pending register (swe_ipr)............................... ..................................... ............................................................. 359 13.3.4 buffer manager csrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 13.3.4.1 buffer manager configuration register (bm_cfg) .......................... ............................................... ............................................................. 361 13.3.4.2 buffer manager drop level register (bm_drop_lvl)............................... ........................................ ........................................................ 362 13.3.4.3 buffer manager flow control pause level register (bm_fc_pause_lvl)..................... ................................ .......................................... 363 13.3.4.4 buffer manager flow control resume level register (bm_fc_resume_lvl) ..................... .............................. ..................................... 364 13.3.4.5 buffer manager broadcast buffer level register (b m_bcst_lvl)................................................ ........... .................................................. 365 13.3.4.6 buffer manager port 0 drop count register (bm_drp_cnt_src_mii) ...................... ................................... ........................................... 366 13.3.4.7 buffer manager port 1 drop count register (bm_drp_cnt_src_1) ...................... ..................................... ............................................ 367 13.3.4.8 buffer manager port 2 drop count register (bm_drp_cnt_src_2) ...................... ..................................... ............................................ 368 13.3.4.9 buffer manager reset status register (bm_rst_sts) ......................... ............................................. ........................................................ 369 13.3.4.10 buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd) ........................ .................. ...................... 370 13.3.4.11 buffer manager random discard table write data register (bm_rndm_dscrd_tbl_wdata) ............................. ........ ...................... 371 13.3.4.12 buffer manager random discard table read data register (bm_rndm_dscrd_tbl_rdata)..................... ................. ...................... 372 13.3.4.13 buffer manager egress port type register (bm_egrss_port_type) .......................... ............................... .......................................... 373 13.3.4.14 buffer manager port 0 egress rate priority queue 0/1 register (bm_egrss_rate_00_01) .................. ................. ............................... 375 13.3.4.15 buffer manager port 0 egress rate priority queue 2/3 register (bm_egrss_rate_02_03) .................. ................. ............................... 376 13.3.4.16 buffer manager port 1 egress rate priority queue 0/1 register (bm_egrss_rate_10_11) .................. ................. ............................... 377 13.3.4.17 buffer manager port 1 egress rate priority queue 2/3 register (bm_egrss_rate_12_13) .................. ................. ............................... 378 13.3.4.18 buffer manager port 2 egress rate priority queue 0/1 register (bm_egrss_rate_20_21) .................. ................. ............................... 379 13.3.4.19 buffer manager port 2 egress rate priority queue 2/3 register (bm_egrss_rate_22_23) .................. ................. ............................... 380 13.3.4.20 buffer manager port 0 default vlan id and priority register (bm_vlan_mii) .................... ......................... ............................................. 381 13.3.4.21 buffer manager port 1 default vlan id and priority register (bm_vlan_1) .................... ........................... .............................................. 382 13.3.4.22 buffer manager port 2 default vlan id and priority register (bm_vlan_2) .................... ........................... .............................................. 383 13.3.4.23 buffer manager port 0 ingress rate drop count register (bm_rate_drp_cnt_src_mii) ...................... ................ ............................. 384 13.3.4.24 buffer manager port 1 ingress rate drop count register (bm_rate_drp_cnt_src_1) ....................... ................. .............................. 385 13.3.4.25 buffer manager port 2 ingress rate drop count register (bm_rate_drp_cnt_src_2) ....................... ................. .............................. 386 13.3.4.26 buffer manager interrupt mask register (bm_imr) .................................. ..................................... .............................................................. 387 13.3.4.27 buffer manager interrupt pending register (bm_ipr) ............................. ....................................... ............................................................. 388 chapter 14 operational characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 14.1 absolute maximum ratings*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 14.2 operating conditions** . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 14.3 power consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 14.4 dc specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 14.5 ac specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 14.5.1 equivalent test load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 14.5.2 reset and configuration strap timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 14.5.3 power-on configuration strap valid timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 14.5.4 microwire timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 14.5.5 spi slave timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 14.6 clock circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 chapter 15 package outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 10 smsc lan9313/lan9313i datasheet 15.1 128-vtqfp package outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 15.2 128-xvtqfp package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 chapter 16 datasheet revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 11 revision 2.0 (02-14-13) datasheet list of figures figure 2.1 internal lan9313/lan9313i block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 2.2 system block diagrams - mac/phy modes of operatio n. . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 3.1 lan9313 128-vtqfp pin assignments (top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 figure 3.2 lan9313/lan9313i 128-xvtqfp pin assignments (top view) . . . . . . . . . . . . . . . . . . . . 28 figure 5.1 functional interrupt register hiera rchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 figure 6.1 switch fabric csr write access flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 figure 6.2 switch fabric csr read access flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 figure 6.3 alr table entry structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 figure 6.4 switch engine transmit queue selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 figure 6.5 switch engine transmit queue calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 figure 6.6 vlan table entry structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 figure 6.7 switch engine ingress flow priority selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8 figure 6.8 switch engine ingress flow priority calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 figure 6.9 hybrid port tagging and un-tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 figure 7.1 port x phy block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 figure 7.2 100base-tx transmit data path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 figure 7.3 100base-tx receive data path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 7.4 direct cable connection vs. cross-over cable conn ection . . . . . . . . . . . . . . . . . . . . . . . . . 98 figure 8.1 eeprom access flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 07 figure 8.2 i2c cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 figure 8.3 i2c eeprom addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 figure 8.4 i2c eeprom byte read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 figure 8.5 i2c eeprom sequential byte reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 figure 8.6 i2c eeprom byte write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 figure 8.7 eeprom erase cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 figure 8.8 eeprom eral cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 figure 8.9 eeprom ewds cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 figure 8.10 eeprom ewen cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 figure 8.11 eeprom read cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 figure 8.12 eeprom write cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 figure 8.13 eeprom wral cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 figure 8.14 eeprom loader flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 figure 8.1 spi reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 figure 8.2 spi writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 figure 8.3 i2c slave addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 figure 8.4 i2c slave reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 figure 8.5 i2c slave writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 figure 9.1 mii mux management path connections - mac mo de unmanaged . . . . . . . . . . . . . . . . . . 132 figure 9.2 mii mux management path connections - mac mo de smi managed . . . . . . . . . . . . . . . . 133 figure 9.3 mii mux management path connections - mac mode i2c/spi managed . . . . . . . . . . . . . 134 figure 9.4 mii mux management path connections - phy mo de unmanaged . . . . . . . . . . . . . . . . . . 135 figure 9.5 mii mux management path connections - phy mo de smi managed . . . . . . . . . . . . . . . . . 136 figure 9.6 mii mux management path connections - phy mode i2c/spi managed . . . . . . . . . . . . . . 137 figure 10.1 ieee 1588 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 figure 10.2 ieee 1588 mess age time stamp point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 figure 13.1 lan9313/lan9313i base register memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 figure 13.2 example switch_mac_addrl, switch_ma c_addrh, and eeprom setup . . . . . . 207 figure 14.1 output equivalent test load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 figure 14.2 nrst reset pin timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 figure 14.3 power-on configuration strap latc hing timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 figure 14.4 microwire timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 figure 14.5 spi slave timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 12 smsc lan9313/lan9313i datasheet figure 15.1 128-vtqfp package definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 figure 15.2 128-vtqfp recommended pcb land pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 figure 15.3 128-xvtqfp package definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 figure 15.4 128-xvtqfp recommended pcb land pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 13 revision 2.0 (02-14-13) datasheet list of tables table 1.1 buffer types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 table 1.2 register bit types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 table 2.1 lan9313/lan9313i modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 table 3.1 lan port 1 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 3.2 lan port 2 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 table 3.3 lan port 1 & 2 power and common pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 table 3.4 lan port 0(external mii) pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 table 3.5 dedicated configuration strap pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 table 3.6 eeprom pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 3.7 serial management pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 3.8 miscellaneous pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 3.9 pll pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 3.10 core and i/o power and ground pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 3.11 no-connect pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 4.1 reset sources and affected lan9313/lan9313i circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 table 4.2 soft-strap configuration strap definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 table 4.3 hard-strap configuration strap defi nitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 table 6.1 switch fabric flow control enable logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 table 6.2 spanning tree states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 table 6.3 typical ingress rate settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 6.4 typical broadcast rate settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 6.5 typical egress rate settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 table 7.1 default phy serial mii addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 table 7.2 4b/5b code table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 table 7.3 phy interrupt sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 table 8.1 i2c/microwire master serial management pins char acteristics. . . . . . . . . . . . . . . . . . . . . . 105 table 8.2 i2c eeprom size ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 table 8.3 microwire eeprom size ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 12 table 8.4 microwire command set for 7 address bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 table 8.5 microwire command set for 9 address bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 table 8.6 microwire command set for 11 address bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 table 8.7 eeprom contents format overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 table 8.8 eeprom configuration bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 table 8.9 spi / i2c slave serial management pins characterist ics . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 table 8.10 supported spi instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 table 9.1 smi frame format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 table 9.2 mii management frame format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 table 10.1 ieee 1588 messag e type detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 table 10.2 time stamp capture delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 table 10.3 ptp multicast addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 table 10.4 typical ieee 1588 clock addend values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 table 12.1 led operation as a function of led_cfg[9:8] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 table 13.1 system control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 table 13.2 switch_mac_addrl, switch_mac_addrh, and eeprom byte ordering . . . . . . . . 206 table 13.3 switch fabric csr to switch_csr_direct_d ata address range map . . . . . . . . . . . . 208 table 13.4 virtual phy mii serially adressable register index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 table 13.5 emulated link partner pause fl ow control ability default values . . . . . . . . . . . . . . . . . . . . 223 table 13.6 emulated link partner default advertised ability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 table 13.7 port 1 & 2 phy mii serially adressable registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 table 13.8 10base-t full duplex advertisemen t default value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 table 13.9 10base-t half duplex advertisement bit default value . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 table 13.10mode[2:0] definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 14 smsc lan9313/lan9313i datasheet table 13.11auto-mdix enable and auto-mdix state bit function ality . . . . . . . . . . . . . . . . . . . . . . . . . 253 table 13.12indirectly accessible switch cont rol and status registers . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 13.13metering/color table register descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 45 table 14.1 supply and current (10base-t full-duplex) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 table 14.2 supply and current (100base-tx full- duplex) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 table 14.3 i/o buffer characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 table 14.4 100base-tx transceiver ch aracteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2 table 14.5 10base-t transceiver char acteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 table 14.6 nrst reset pin timing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 table 14.7 power-on configuration strap latching timing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 table 14.8 microwire timing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 table 14.9 spi slave timing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 table 14.10lan9313/lan9313i crystal specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 table 15.1 128-vtqfp dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 table 15.2 128-xvtqfp dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 table 16.1 customer revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 15 revision 2.0 (02-14-13) datasheet chapter 1 preface 1.1 general terms 100bt 100base-t (100mbps fast ethernet, ieee 802.3u) adc analog-to-digital converter alr address logic resolution blw baseline wander bm buffer manager - part of the switch fabric bpdu bridge protocol data unit - messages which carry the spanning tree protocol information byte 8-bits csma/cd carrier sense multiple access / collision detect csr control and status registers ctr counter da destination address dword 32-bits epc eeprom controller fcs frame check sequence - the extra checksum characters added to the end of an ethernet frame, used fo r error detection and correction. fifo first in first out buffer fsm finite state machine gpio general purpose i/o host external system (includes proces sor, application software, etc.) igmp internet group management protocol inbound refers to data input to the lan9313/lan9313i from the host level-triggered sticky bit this type of status bit is set whenever the condition that it represents is asserted. the bit remains set until the condition is no longer true, and the status bit is cleared by writing a zero. lsb least significant bit lsb least significant byte mdi medium dependant interface mdix media independent interface with crossover mii media independent interface miim media independent interface management mil mac interface layer downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 16 smsc lan9313/lan9313i datasheet mlt-3 multi-level transmission encoding (3-levels). a tri-level encoding method where a change in the logic level represents a code bit 1 and the logic output remaining at the same level represents a code bit 0. msb most significant bit msb most significant byte nrzi non return to zero inverted. this encoding method inverts the signal for a 1 and leaves the signal unchanged for a 0 n/a not applicable nc no connect oui organizationally unique identifier outbound refers to data output from t he lan9313/lan9313i to the host pio cycle program i/o cycle. an sram-like read or write cycle on the hbi. piso parallel in serial out pll phase locked loop ptp precision time protocol reserved refers to a reserved bit field or addr ess. unless otherwise noted, reserved bits must always be zero for write operations. unless otherwise noted, values are not guaranteed when reading reserved bits. unless otherwise noted, do not read or write to reserved addresses. rtc real-time clock sa source address sfd start of frame delimiter - the 8-bit value indicating the end of the preamble of an ethernet frame. sipo serial in parallel out smi serial management interface sqe signal quality error (also known as heartbeat) ssd start of stream delimiter udp user datagram protocol - a connecti onless protocol run on top of ip networks uuid universally unique identifier word 16-bits downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 17 revision 2.0 (02-14-13) datasheet 1.2 buffer types table 1.1 describes the pin buffer type notation used in chapter 3, "pin description and configuration," on page 27 and throughout this document. table 1.1 buffer types buffer type description is schmitt-triggered input o8 output with 8ma sink and 8ma source od8 open-drain output with 8ma sink o12 output with 12ma sink and 12ma source od12 open-drain output with 12ma sink pu 50ua (typical) internal pull-up. unless otherwis e noted in the pin description, internal pull- ups are always enabled. note: internal pull-up resistors prevent unconnected inputs from floating. do not rely on internal resistors to drive signals external to the lan9313/lan9313i. when connected to a load that must be pulled high, an external resistor must be added. pd 50ua (typical) internal pull-down. unless ot herwise noted in the pin description, internal pull-downs are always enabled. note: internal pull-down resistors prevent unconnected inputs from floating. do not rely on internal resistors to drive signals external to the lan9313/lan9313i. when connected to a load that must be pulled low, an external resistor must be added. ai analog input ao analog output aio analog bi-directional iclk crystal oscillator input pin oclk crystal oscillator output pin p power pin downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 18 smsc lan9313/lan9313i datasheet 1.3 register nomenclature table 1.2 describes the register bit attribute notation used throughout this document. many of these register bit notations can be co mbined. some examples of this are shown below: ? r/w: can be written. will return current setting on a read. ? r/wac: will return current setting on a read. writing anything clears the bit. table 1.2 register bit types register bit type notation register bit description r read: a register or bit with this attribute can be read. w read: a register or bit with this attribute can be written. ro read only: read only. writes have no effect. wo write only: if a register or bit is write-only, reads will return unspecified data. wc write one to clear: writing a one clears the value. writing a zero has no effect wac write anything to clear: writing anything clears the value. rc read to clear: contents is cleared after the read. writes have no effect. ll latch low: clear on read of register. lh latch high: clear on read of register. sc self-clearing: contents are self-cleared after the being set. writes of zero have no effect. contents can be read. ss self-setting: contents are self-setting after being cleared. writes of one have no effect. contents can be read. ro/lh read only, latch high: bits with this attribute will stay high until the bit is read. after it is read, the bit will either remain high if the high condition remains, or will go low if the high condition has been removed. if the bit has not been read, the bit will remain high regardless of a change to the high conditio n. this mode is used in some ethernet phy registers. nasr not affected by software reset. the state of nasr bits do not change on assertion of a software reset. reserved reserved field: reserved fields must be written with zeros to ensure future compatibility. the value of reserved bits is not guaranteed on a read. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 19 revision 2.0 (02-14-13) datasheet chapter 2 introduction 2.1 general description the lan9313/lan9313i is a full featured, 3 por t 10/100 managed ethernet switch designed for embedded applications where performance, flexibility, ease of integration and system cost control are required. the lan9313/lan9313i combines all the fu nctions of a 10/100 switch system, including the switch fabric, packet buffers, buffer manager, media access controllers (macs), phy transceivers, and serial management. the lan9313/lan9313i complies with the ieee 802.3 (full/half-duplex 10base- t and 100base-tx) ethernet protocol specification and 802.1d/802.1q network management protocol specifications, enabling compatibility with industry standard ethernet and fast ethernet applications. at the core of the lan9313/lan9313i is the high performance, high efficiency 3 port ethernet switch fabric. the switch fabric contains a 3 port vlan layer 2 switch engine that supports untagged, vlan tagged, and priority tagged frames. the switch fabric provides an extensive feature set which includes spanning tree protocol support, multicast packe t filtering and quality of service (qos) packet prioritization by vlan tag, dest ination address, port default valu e or diffserv/tos, allowing for a range of prioritization implementations. 32k of buff er ram allows for the storage of multiple packets while forwarding operations are completed, and a 1k entry forwarding table provides ample room for mac address forwarding tables. each port is allocated a cluster of 4 dynamic qos queues which allow each queue size to grow and shrink with traffic, effectively utilizing all available memory. this memory is managed dynamically via the buffer manager block wi thin the switch fabric. all aspects of the switch fabric are managed via the switch fabric configuration and status registers, which are indirectly accessible via the system cont rol and status registers. the lan9313/lan9 313i provides 3 sw itched ports. each port is full y compliant with the ieee 802.3 standard and all internal macs and phys support full/ha lf duplex 10base- t and 100base-tx operation. the lan9313/lan9313i provides 2 on-ch ip phys, 1 virtual phy and 3 macs. the virtual phy and the third mac are used to connect the lan9313/lan9313i switch fabric to an external mac or phy. all ports support automatic or manual full duplex flow control or half duplex backpressure (forced collision) flow control. 2k jumbo packet (2048 byte) s upport allows for oversized packet transfers, effectively increasing throughput whil e deceasing cpu load. all mac and phy related settings are fully configurable via their re spective registers within the lan9313/lan9313i. the integrated spi, i 2 c and smi slave controllers allow for full serial management of the lan9313/lan9313i via the integrated spi/i 2 c serial interface or mii interface respectively. the inclusion of these interfaces allo ws for greater flexibility in the incorporation of the lan9313/lan9313i into various designs. it is this flexibility which allows the lan9313/lan9313i to operate in 2 different modes and under various management conditions. in mac mode, the lan9313/lan9313i can be connected to an external phy via the mii interf ace. in phy mode, the lan9313/lan9313i can be connected to an external mac via the mii interface. in both mac and phy modes, the lan9313/lan9313i can be unmanaged, smi managed, i 2 c managed or spi managed. this flexibility in management makes the lan9313/lan9313i a c andidate for virtually all switch applications. the lan9313/lan9313i contains an i 2 c/microwire master eeprom controller for connection to an optional eeprom. this allows for the storage and retrieval of static data. the internal eeprom loader can be optionally configured to automatically load stored configuration settings from the eeprom into the lan9313/lan931 3i at reset, allowing the lan9313/lan9313 i to operate unmanaged. in addition to the primary functionality described above, the lan9313/lan9 313i provides additional features designed for extended functionality. thes e include a configurable 16-bit general purpose timer (gpt), a 32-bit 25mhz free running counter, a 12-bit configurable gpio/led interface, and ieee 1588 time stamping on all ports and select gpios. the ieee time stam p unit provides a 64-bit tunable clock for accurate ptp timing and a timer comparator to allow time based interrupt generation. the lan9313/lan9313is performance, features and small size make it an ideal solution for many applications in the consumer el ectronics and industrial automati on markets. targeted applications include: set top boxes (cable, satellite and ip), digital televisions, digital video recorders, voice over ip and video phone systems, home gateways, and test and measurement equipment. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 20 smsc lan9313/lan9313i datasheet 2.2 block diagram figure 2.1 internal lan931 3/lan9313i block diagram to optional eeprom (via i 2 c/microwire master) eeprom controller i 2 c (master) microwire (master) eeprom loader register access mux smi (slave) controller spi (slave) i 2 c (slave) controller system registers (csrs) mii mode mux spi/i 2 c mdio mdio mii to optional phy, mac, or smi master management mode configuration straps mdio mii phy management interface (pmi) mdio ieee 1588 time stamp registers virtual phy 10/100 phy registers 10/100 phy registers switch registers (csrs) ieee 1588 time stamp ieee 1588 time stamp switch fabric dynamic qos 4 queues dynamic qos 4 queues dynamic qos 4 queues switch engine buffer manager search engine frame buffers mii mdio mii mdio to ethernet to ethernet lan9313/lan9313i gpio/led controller ieee 1588 time stamp clock/events to optional gpios/leds system interrupt controller irq gp timer free-run clk system clocks/ reset/pme controller external 25mhz crystal to optional cpu serial management (via i 2 c/spi slave) i 2 c/microwire port 0 10/100 mac port 1 10/100 mac port 2 10/100 mac downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 21 revision 2.0 (02-14-13) datasheet 2.2.1 system clocks/r eset/pme controller a clock module contained within the lan9313/lan9 313i generates all the system clocks required by the device. this module interfaces directly with the external 25mhz crystal/oscillator to generate the required clock divisions for each internal module, with the exceptio n of the 1588 cl ocks, which are generated in the 1588 time stamp clock/events m odule. a 16-bit general purpose timer and 32-bit free-running clock are provided by this module for general purpose use. the port 1 & 2 phys provide general power-down and energy detect power-down modes, which allow a reduction in phy power consumption. the lan9313/lan9313i reset events are categorized as chip-level resets, multi-module resets, and single-module resets. a chip-level reset is initiated by assertion of any of the following input events: ? power-on reset ? nrst pin reset a multi-module reset is initiated by assertion of the following: ? digital reset - digital_rst (bit 0) in the reset control register (reset_ctl) - resets all lan9313/lan9313i sub-modules except the ethernet phys (port 1 phy, port 2 phy, and virtual phy) a single-module reset is initiated by assertion of the following: ? port 2 phy reset - phy2_rst (bit 2) in the reset control register (reset_ctl) or reset (bit 15) in the port x phy basic control r egister (phy_basic_control_x) - resets the port 2 phy ? port 1 phy reset - phy1_rst (bit 1) in the reset control register (reset_ctl) or reset (bit 15) in the port x phy basic control r egister (phy_basic_control_x) - resets the port 1 phy ? virtual phy reset - vphy_rst (bit 0) in the reset control register (reset_ctl) or reset (bit 15) in the virtual phy basic control register (vphy_basic_ctrl) - resets the virtual phy 2.2.2 system interrupt controller the lan9313/lan9313i provides a multi-tier programmable interrupt structure which is controlled by the system interrupt controller. at the top level are the interrupt status register (int_sts) and interrupt enable register (int_en) . these registers aggregate and control all interrupts from the various lan9313/lan9313i sub-modules. the lan931 3/lan9313i is capable of generating interrupt events from the following: ? 1588 time stamp ? switch fabric ? ethernet phys ? gpios ? general purpose timer ? software (general purpose) a dedicated programmable irq interrupt output pi n is provided for external indication of any lan9313/lan9313i interrupts. the irq pin is controlled via the interrupt configuration register (irq_cfg) , which allows configuration of the irq buffer type, polarity, and de-assertion interval. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 22 smsc lan9313/lan9313i datasheet 2.2.3 switch fabric the switch fabric consists of the following majo r function blocks: ? 10/100 macs there is one 10/100 ethernet mac per switch fabr ic port, which provides basic 10/100 ethernet functionality, including transmission deferral, collision back-off/retry, tx/rx fcs checking/generation, tx/rx pause flow control, and transmit back pressure. the 10/100 macs act as an interface between the switch engine and t he 10/100 phys (for ports 1 and 2). the port 0 10/100 mac interfaces the switch eng ine to the external mac/phy (see section 2.3, "modes of operation" ). each 10/100 mac includes rx and tx fifos and per port statistic counters. ? switch engine this block, consisting of a 3 port vlan layer 2 switching engine, provides the control for all forwarding/filtering rules and supports untagged, vlan tagged, and priority tagged frames. the switch engine provides an extensive feature set which includes spanning tree protocol support, multicast packet filtering and quality of service (qos ) packet prioritization by vlan tag, destination address, and port default value or diffserv/tos, allowing for a range of prioritization implementations. a 1k entry forwarding table provides ample room for mac address forwarding tables. ? buffer manager this block controls the free buffer space, multi-level transmit queues, transmission scheduling, and packet dropping of the switch fabric. 32k of buffer ram allows for the storage of multiple packets while forwarding operations are completed. each port is allocated 1a cluster of 4 dynamic qos queues which allow each queue size to grow and shrink with traffic, effectively utilizing all available memory. this memory is managed dynamically via the buffer manager block. ? switch csrs this block contains all switch related control and status registers, and allows all aspects of the switch fabric to be managed. these registers ar e indirectly accessible via the system control and status registers 2.2.4 ethernet phys the lan9313/lan9313i contains three phys: port 1 phy, port 2 phy and a virtual phy. the port 1 & 2 phys are identical in functionality and each connect their corresponding ethernet signal pins to the switch fabric mac of their re spective port. these phys interface with their respective mac via an internal mii interface. the virtual phy provides the virtual functionality of a phy and allows connection of an external mac to port 0 of the switch fabric as if it was con nected to a single port phy. all phys comply with the ieee 802.3 physical layer for twist ed pair ethernet and can be configured for full/half duplex 100 mbps (100base-tx) or 10mbps (10base-t) ethernet operation. all phy registers follow the ieee 802.3 (clause 22.2.4) spec ified mii management register set. 2.2.5 phy management interface (pmi) the phy management interface (pmi) is used to serially access the internal phys as well as the external phy on the mii pins (in mac mode only, see section 2.3, "modes of operation" ). the pmi implements the ieee 802.3 management protocol, providing read/write commands for phy configuration. 2.2.6 spi/i 2 c slave controller this module provides an spi/i 2 c slave interface which can be used for cpu serial management of the lan9313/lan9313i. the spi slave controller allows cpu access to all system csrs for configuration and management. the spi slave controller supports single regist er and multiple register read and write commands. multiple read and multiple write commands support incrementing, decre menting, and static addressing. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 23 revision 2.0 (02-14-13) datasheet the i 2 c slave controller implements the low level i 2 c slave serial interface (start and stop condition detection, data bit transmission/reception, and a cknowledge generation/reception), handles the slave command protocol, and performs system r egister reads and writes. the i 2 c slave controller conforms to the philips i 2 c-bus specification . a list of management modes and configurations settings for these modes is discussed in section 2.3, "modes of operation" 2.2.7 smi slave controller this module provides a smi slave interfac e which can be used for cpu management of the lan9313/lan9313i via the mii pins, and allows cp u access to all system csrs. smi uses the same pins and protocol of the ieee mii management functi on, and differs only in that smi provides access to all internal registers by using a non-standard ex tended addressing map. the smi protocol co-exists with the mii management protocol by using the upper half of the phy address space (16 through 31). a list of management modes and configurations settings for these modes is discussed in section 2.3, "modes of operation" 2.2.8 eeprom controller/loader the eeprom controller is an i 2 c/microwire master module which interfaces an optional external eeprom with the system register bus and the eeprom loader. multiple types (i 2 c/microwire) and sizes of external eeproms ar e supported. configuration of the eepr om type and size are accomplished via the eeprom_type_strap and eeprom_si ze_strap[1:0] configuration straps respectively. various commands are su pported for each eeprom type, allowing for the st orage and retrieval of static data. the i 2 c interface conforms to the philips i 2 c-bus specification . the eeprom loader module interfaces to the eeprom controller, ethernet phys, and the system csrs. the eeprom loader provides the automatic loading of confi guration settings from the eeprom into the lan9313/lan931 3i at reset, allowing the lan9313/lan9313 i to operate unmanaged. the eeprom loader runs upon a pin reset (nrst), power-on reset (por), digital reset (digital_rst bit in the reset control register (reset_ctl) ), or upon the issuance of a reload command via the eeprom command register (e2p_cmd) . 2.2.9 1588 time stamp the ieee 1588 time stamp modules provide hardw are support for the ieee 1588 precision time protocol (ptp), allowing clock syn chronization with remote ethernet devices, packet time stamping, and time driven event gener ation. time stamping is supported on all ports, with an individual ieee 1588 time stamp module connected to each port via the mii bus. any port may function as a master or a slave clock per the ieee 1588 specificati on, and the lan9313/lan9313i as a whole may function as a boundary clock. a 64-bit tunable clock is provided that is used as the time source for all ieee 1588 time stamp related functions. the ieee 1588 cl ock/events block prov ides ieee 1588 clock comparison based interrupt generation and time stamp related gpio event generation. two lan9313/lan9313i gpio pins (gpio[8:9]) can be used to trigger a time stamp ca pture when configured as an input, or output a signal from the gpio based on an ieee 1588 clock target compare event when configured as an output. all features of the ieee 1588 hardware time stamp unit can be monitored an d configured via their respective ieee 1588 configur ation and status registers (csrs). 2.2.10 gpio/led controller the lan9313/lan9313i provides 12 configurable general-purpose input/output pins which are controlled via this module. these pins can be i ndividually configured vi a the gpio/led csrs to function as inputs, push-pull outputs, or open drain outputs and each is capable of interrupt generation with configurable polarity. two of the gpio pins (gpi o[9:8]) can be used for ieee 1588 timestamp downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 24 smsc lan9313/lan9313i datasheet functions, allowing gpio driven 1588 time clock capture when configured as an input, or gpio output generation based on an ieee 1588 clock target compare event. in addition, 8 of the gpio pins c an be alternatively configured as led outputs. these pins, gpio[7:0] (np1led[3:0] and np2led[3: 0]), may be enabled to drive ethernet status leds for external indication of various attributes of the switch ports. 2.3 modes of operation the lan9313/lan9313i is designed to integrate into various embedded environments. to accomplish compatibility with a wide range of applications, the lan9313/lan9313i can operate in 2 different modes (mac mode and phy mode) and under vari ous management conditi ons (unmanaged, smi managed, i 2 c managed, or spi managed). the mo de and management type of the lan9313/lan9313i is determined by the mii_mode_strap and mngt_m ode_strap[1:0] configuration straps respectively. these modes and management types are detail ed in the following sections. figure 2.2 displays a typical system configuration for each mode and management type supported by the lan9313/lan9313i. 2.3.1 mac mode the lan9313/lan9313i mac mode utilizes an external phy, which is connected to the mii pins, to provide a third ethernet network connection. in this mode, t he lan9313/lan9313i acts as a mac, providing a communication path between the switch fabric and the external phy. in mac mode, the lan9313/lan9313i may be unmanaged, smi managed, i 2 c managed, or spi managed as detailed in section 2.3.3, "management modes" . when an eeprom is connected, the eeprom loader can be used to load the initial device configuration from the ex ternal eeprom via the i 2 c/microwire interface. once operational, if managed, the cpu can use the i 2 c/microwire interface to read or write the eeprom. 2.3.2 phy mode the lan9313/lan9313i phy mode utilizes an external mac to provide a network path for the host cpu. the external mii pins of the lan9313/lan9313i must be connected to an external mac, providing a communication path to the switch fabric. in phy mode, the lan9313/lan9313i may be unmanaged, smi managed, i 2 c managed, or spi managed as detailed in section 2.3.3, "management modes" . when an eeprom is connected, the eeprom loader can be used to load the initial device configuration from the ex ternal eeprom via the i 2 c/microwire interface. once operational, if managed, the cpu can use the i 2 c/microwire interface to read or write the eeprom. 2.3.3 management modes the lan9313/lan9313i provides various modes of management in both mac and phy modes of operation. two separate interfaces may be used to manage the lan9313/lan9313i: the i 2 c/spi slave interface or the smi/miim(media independent interface management) slave interface. the i 2 c/spi interface runs as either an i 2 c slave or spi slave and is used as a register access path for an external cpu. the smi/miim interface runs as ei ther an smi/miim slave or miim master. the master mode is used to access an external phys registers under cpu control (assuming the cpu is using i 2 c or spi). the slave mode is used for register access by the cpu or external mac and provides access to either the internal port 1&2 phy registers or to all non-phy registers (using addresses 16-31 and a non-standard extended address map). miim and smi use the same pins and protocol and differ only in that smi provides access to all internal registers while miim provides access to only the port 1&2 phy registers. a special mode provides access to the virtual phy, which mimics the register operation of a single port standalone phy. this is used for soft ware compatibility during unmanaged operation. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 25 revision 2.0 (02-14-13) datasheet the selection of lan9313/lan9313i modes is determined at startup via the mii_mode_strap and mngt_mode_strap[1:0] configurat ion straps as detailed in ta b l e 2 . 1 . system configuration diagrams for each mode of the lan9313/la n9313i are provided in figure 2.2 . table 2.1 lan9313/lan9313i modes mode i 2 c/microwire eeprom interface i 2 c/spi slave interface smi/miim interface mii_mode_ strap value mngt_mode_ strap[1:0] value mac mode unmanaged used to load initial configuration from eeprom not used not used 0 00 mac mode smi managed used to load initial configuration from eeprom and for cpu r/w access to eeprom not used smi/miim slave, used for cpu access to internal phys and non-phy registers 00 1 mac mode i 2 c managed used to load initial configuration from eeprom and for cpu r/w access to eeprom i 2 c slave miim master, used for cpu access to external phy registers 01 0 mac mode spi managed used to load initial configuration from eeprom and for cpu r/w access to eeprom spi slave miim master, used for cpu access to external phy registers 01 1 phy mode unmanaged used to load initial configuration from eeprom not used virtual miim slave, used for external mac access to virtual phy registers 10 0 phy mode smi managed used to load initial configuration from eeprom and for cpu r/w access to eeprom not used smi/miim slave, used for cpu access to internal phys, virtual phy, and non-phy registers 10 1 phy mode i 2 c managed used to load initial configuration from eeprom and for cpu r/w access to eeprom i 2 c slave virtual miim slave, used for external mac access to virtual phy registers 11 0 phy mode spi managed used to load initial configuration from eeprom and for cpu r/w access to eeprom spi slave virtual miim slave, used for external mac access to virtual phy registers 11 1 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 26 smsc lan9313/lan9313i datasheet figure 2.2 system block diagrams - mac/phy modes of operation lan9313/lan9313i mac modes to ethernet magnetics to ethernet magnetics 10/100 phy to ethernet magnetics mii eeprom (optional) lan9313 eeprom i 2 c/microwire i 2 c/ microwire to ethernet magnetics to ethernet magnetics 10/100 phy to ethernet magnetics mii eeprom (optional) lan9313 eeprom i 2 c/microwire i 2 c/ microwire miim/ smi unmanaged smi managed i 2 c managed spi managed microprocessor/ microcontroller smi/miim miim to ethernet magnetics to ethernet magnetics 10/100 phy to ethernet magnetics mii lan9313 i 2 c/spi slave i 2 c miim/ smi microprocessor/ microcontroller to ethernet magnetics to ethernet magnetics 10/100 phy to ethernet magnetics mii lan9313 miim/ smi microprocessor/ microcontroller miim miim eeprom (optional) eeprom i 2 c/microwire i 2 c/ microwire i 2 c/spi slave spi eeprom (optional) eeprom i 2 c/microwire i 2 c/ microwire lan9313/lan9313i phy modes to ethernet magnetics to ethernet magnetics 10/100 mac mii eeprom (optional) lan9313 eeprom i 2 c/microwire i 2 c/ microwire miim/ smi to ethernet magnetics to ethernet magnetics 10/100 mac mii eeprom (optional) lan9313 eeprom i 2 c/microwire i 2 c/ microwire miim/ smi unmanaged smi managed i 2 c managed spi managed microprocessor/ microcontroller smi/miim to ethernet magnetics to ethernet magnetics 10/100 mac mii lan9313 miim/ smi microprocessor/ microcontroller to ethernet magnetics to ethernet magnetics 10/100 mac mii lan9313 miim/ smi microprocessor/ microcontroller miim miim miim i 2 c/spi slave i 2 c eeprom (optional) eeprom i 2 c/microwire i 2 c/ microwire i 2 c/spi slave spi eeprom (optional) eeprom i 2 c/microwire i 2 c/ microwire downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 27 revision 2.0 (02-14-13) datasheet chapter 3 pin description and configuration 3.1 pin diagrams 3.1.1 128-vtqfp pin diagram figure 3.1 lan9313 128-vtqfp pin assignments (top view) smsc lan9313 128-vtqfp top view 97 vss eeclk/ee_scl/ eeprom_size_1 eedo/eeprom_type eecs/eeprom_size_0 vdd33io nc nc xi vdd18core vdd18pll xonc test2 txp1 txn1 vss vss rxn1 vdd33a1 vdd33a1 rxp1 exres vdd18tx1 vdd18tx2 vdd33bias rxp2 vdd33a2 vdd33a2 rxn2 txn2 txp2 vss vdd33io txer irq mii_duplex rxd0 nc nc auto_mdix_1 nc vdd33io auto_neg_1 duplex_1 speed_1 fd_fc_1 bp_en_1 vss manual_fc_1 vdd33io led_fun0 led_en led_fun1 auto_neg_2 auto_mdix_2 vdd18core speed_2 duplex_2 vdd33io fd_fc_2 bp_en_2 speed_mii manual_fc_2 vdd33io eedi/ee_sda nc phy_addr_sel np1led0/gpio0 vdd33io np1led2/gpio2 np1led1/gpio1 vdd18core np1led3/gpio3 np2led0/gpio4 vdd33io np2led2/gpio6 np2led1/gpio5 gpio8 np2led3/gpio7 vss vdd33io gpio10 gpio9 nc gpio11 vdd18core test1 vdd33io vdd33io sck/scl nrst so nscs vdd33io si/sda vdd18core nc vdd18core nc rxd1 txen vdd33io rxd2 rxer rxd3 rxdv rxclk vdd33io mdio mdc vdd18core col crs txd3 vss vdd33io txd2 txd0 txd1 mii_mode txclk vdd33io mngt_mode1 manual_fc_mii mngt_mode0 bp_en_mii fd_fc_mii duplex_pol_mii 9899 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 6463 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 9695 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 28 smsc lan9313/lan9313i datasheet 3.1.2 128-xvtqfp pin diagram figure 3.2 lan9313/lan9313i 128-xvt qfp pin assignments (top view) vss note: exposed pad on bottom of package must be connected to ground smsc lan9313/lan9313i 128-xvtqfp top view 97 vss eeclk/ee_scl/ eeprom_size_1 eedo/eeprom_type eecs/eeprom_size_0 vdd33io nc nc xi vdd18core vdd18pll xonc test2 txp1 txn1 vss vss rxn1 vdd33a1 vdd33a1 rxp1 exres vdd18tx1 vdd18tx2 vdd33bias rxp2 vdd33a2 vdd33a2 rxn2 txn2 txp2 vss vdd33io txer irq mii_duplex rxd0 nc nc auto_mdix_1 nc vdd33io auto_neg_1 duplex_1 speed_1 fd_fc_1 bp_en_1 vss manual_fc_1 vdd33io led_fun0 led_en led_fun1 auto_neg_2 auto_mdix_2 vdd18core speed_2 duplex_2 vdd33io fd_fc_2 bp_en_2 speed_mii manual_fc_2 vdd33io eedi/ee_sda nc phy_addr_sel np1led0/gpio0 vdd33io np1led2/gpio2 np1led1/gpio1 vdd18core np1led3/gpio3 np2led0/gpio4 vdd33io np2led2/gpio6 np2led1/gpio5 gpio8 np2led3/gpio7 vss vdd33io gpio10 gpio9 nc gpio11 vdd18core test1 vdd33io vdd33io sck/scl nrst so nscs vdd33io si/sda vdd18core nc vdd18core nc rxd1 txen vdd33io rxd2 rxer rxd3 rxdv rxclk vdd33io mdio mdc vdd18core col crs txd3 vss vdd33io txd2 txd0 txd1 mii_mode txclk vdd33io mngt_mode1 manual_fc_mii mngt_mode0 bp_en_mii fd_fc_mii duplex_pol_mii 9899 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 6463 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 9695 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 29 revision 2.0 (02-14-13) datasheet 3.2 pin descriptions this section contains the descriptions of the lan 9313/lan9313i pins. the pin descriptions have been broken into functional groups as follows: ? lan port 1 pins ? lan port 2 pins ? lan port 1 & 2 power and common pins ? lan port 0(external mii) pins ? dedicated configuration strap pins ? eeprom pins ? serial management pins ? miscellaneous pins ? pll pins ? core and i/o power and ground pins ? no-connect pins note: a list of buffer type definitions is provided in section 1.2, "buffer types," on page 17 . table 3.1 lan port 1 pins pin name symbol buffer type description 89-92 port 1 led indicators np1led[3:0] od12 led indicators: when configured as led outputs via the led configuration register (led_cfg) , these pins are open-drain, active low outputs and the pull-ups and input buffers are disabled. the functionality of each pin is determined via the led_cfg[9:8] bits. general purpose i/o data gpio[3:0] is/o12/ od12 (pu) general purpose i/o data: when configured as gpio via the led configuration register (led_cfg) , these general purpose signals are fully programmable as either push-pull outputs, open-drain outputs or schmitt-triggered inputs by writing the general purpose i/o configuration register (gpio_cfg) and general purpose i/o data & direction register (gpio_data_dir) . the pull-ups are enabled in gpio mode. the input buffers are disabled when set as an output. note: see chapter 12, "gpio/led controller," on page 146 for additional details. 110 port 1 ethernet tx negative txn1 aio ethernet tx negative: negative output of port 1 ethernet transmitter. see note 3.1 for additional information. 111 port 1 ethernet tx positive txp1 aio ethernet tx positive: positive output of port 1 ethernet transmitter. see note 3.1 for additional information. 115 port 1 ethernet rx negative rxn1 aio ethernet rx negative: negative input of port 1 ethernet receiver. see note 3.1 for additional information. 116 port 1 ethernet rx positive rxp1 aio ethernet rx positive: positive input of port 1 ethernet receiver. see note 3.1 for additional information. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 30 smsc lan9313/lan9313i datasheet note 3.1 the pin names for the twisted pair pins apply to a normal connection. if hp auto-mdix is enabled and a reverse connection is detected or manually selected, the rx and tx pins will be swapped internally. note 3.2 the pin names for the twisted pair pins apply to a normal connection. if hp auto-mdix is enabled and a reverse connection is detected or manually selected, the rx and tx pins will be swapped internally. table 3.2 lan port 2 pins pin name symbol buffer type description 83-86 port 2 led indicators np2led[3:0] od12 led indicators: when configured as led outputs via the led configuration register (led_cfg) , these pins are open-drain, active low outputs and the pull-ups and input buffers are disabled. the functionality of each pin is determined via the led_cfg[9:8] bits. general purpose i/o data gpio[7:4] is/o12/ od12 (pu) general purpose i/o data: when configured as gpio via the led configuration register (led_cfg) , these general purpose signals are fully programmable as either push-pull outputs, open-drain outputs or schmitt-triggered inputs by writing the general purpose i/o configuration register (gpio_cfg) and general purpose i/o data & direction register (gpio_data_dir) . the pull-ups are enabled in gpio mode. the input buffers are disabled when set as an output. note: see chapter 12, "gpio/led controller," on page 146 for additional details. 127 port 2 ethernet tx negative txn2 aio ethernet tx negative: negative output of port 2 ethernet transmitter. see note 3.2 for additional information. 126 port 2 ethernet tx positive txp2 aio ethernet tx positive: positive output of port 2 ethernet transmitter. see note 3.2 for additional information. 124 port 2 ethernet rx negative rxn2 aio ethernet rx negative: negative input of port 2 ethernet receiver. see note 3.2 for additional information. 123 port 2 ethernet rx positive rxp2 aio ethernet rx positive: positive input of port 2 ethernet receiver. see note 3.2 for additional information. table 3.3 lan port 1 & 2 power and common pins pin name symbol buffer type description 119 bias reference exres ai bias reference: used for internal bias circuits. connect to an external 12.4k ohm, 1% resistor to ground. 114,117 +3.3v port 1 analog power supply vdd33a1 p +3.3v port 1 analog power supply refer to the lan9313/lan9313i reference schematic for additional connection information. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 31 revision 2.0 (02-14-13) datasheet 122,125 +3.3v port 2 analog power supply vdd33a2 p +3.3v port 2 analog power supply refer to the lan9313/lan9313i reference schematic for additional connection information. 120 +3.3v master bias power supply vdd33bias p +3.3v master bias power supply refer to the lan9313/lan9313i reference schematic for additional connection information. 121 port 2 transmitter +1.8v power supply vdd18tx2 p port 2 transmitter +1.8v power supply: this pin is supplied from the internal phy voltage regulator. this pin must be tied to the vdd18tx1 pin for proper operation. refer to the lan9313/lan9313i reference schematic for additional connection information. 118 port 1 transmitter +1.8v power supply vdd18tx1 p port 1 transmitter +1.8v power supply: this pin must be connected directly to the vdd18tx2 pin for proper operation. refer to the lan9313/lan9313i reference schematic for additional connection information. table 3.4 lan port 0(external mii) pins pin name symbol buffer type description 19,20,22,23 mii transmit data txd[3:0] is/o8 (pd) note 3.3 mii transmit data: the functionality of these signals is dependant on the mode of the lan9313/lan9313i: ? in mac mode, this is the data from the lan9313/lan9313i switch to an external phy. see note 3.3 . ? in phy mode, this is the data from an external mac to the lan9313/lan9313i switch. 4 mii transmitter enable txen is/o8 (pd) note 3.3 mii transmit enable: indicates valid data on txd[3:0]. ? in mac mode, this signal is output to an external phy. see note 3.3 . ? in phy mode, this signal is input from an external mac. table 3.3 lan port 1 & 2 powe r and common pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 32 smsc lan9313/lan9313i datasheet 9 mii receive error rxer is/o8 (pd) note 3.3 mii receive error: indicates a receiv e error in the packet. ? in mac mode, this signal is input from an external phy. ? in phy mode, this signal is output to an external mac. this signal is always driven low when in phy mode. see note 3.3 . 62 mii transmit error txer is/o8 (pd) note 3.3 mii transmit error: indicates a transmit error in the packet. ? in mac mode, this signal is output to an external phy and indicates an invalid symbol is to be transmitted. this signal is always driven low when in mac mode. see note 3.3 . ? in phy mode, this signal is input from an external mac and indicates the current packet should be aborted. 17 mii collision col is/o8 (pu) note 3.4 mii collision: indicates a collision event. ? in mac mode, this signal is input from an external phy. ? in phy mode, this signal is output to an external mac. see note 3.4 . 16 mii carrier sense crs is/o8 (pd) note 3.3 mii carrier sense: indicates a network carrier. ? in mac mode, this signal is input from an external phy. ? in phy mode, this signal is output to an external mac. see note 3.3 . 24 mii transmit clock txclk is/o12 (pd) note 3.3 mii transmit clock: ? in mac mode, this is the transmitter clock input from an external phy. ? in phy mode, this is the transmitter clock output to an external mac. see note 3.3 . 8,6,5,61 mii receive data rxd[3:0] is/o8 (pd) note 3.3 mii receive data: ? in mac mode, this is the data from an external phy to the lan9313/lan9313i switch. ? in phy mode, this is the data from the lan9313/lan9313i switch to an external mac. see note 3.3 . table 3.4 lan port 0(external mii) pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 33 revision 2.0 (02-14-13) datasheet 11 mii receive data valid rxdv is/o8 (pd) note 3.3 mii receive data valid: indicates valid data on rxd[3:0]. ? in mac mode, this signal is input from an external phy. ? in phy mode, this signal is output to an external mac. see note 3.3 . 10 mii receive clock rxclk is/o12 (pd) note 3.3 mii receive clock: ? in mac mode, this is the receiver clock input from an external phy. ? in phy mode, this is the receiver clock output to an external mac. see note 3.3 . 12 mii management data mdio is/o8 note 3.5 mii management data: ? in smi/mii slave management modes, this signal is the management data to/from an external master. ? in mii master management modes, this signal is the management data to/from an external phy. see note 3.5 15 mii management clock mdc is/o8 note 3.6 mii management clock: ? in smi/mii slave management modes, this is the management clock input from an external master. ? in mii master management modes, this is the management clock output to an external phy. see note 3.6 . 60 mii port duplex mii_duplex is (pu) note 3.7 mii port duplex: this pin sets the duplex of the mii port. its value can be changed at any time (live value) and can be overridden by disabling the auto-negotiation (vphy_an) bit in the virtual phy basic control register (vphy_basic_ctrl) of the virtual phy. in mac mode, this signal is typically tied to the duplex indication from the external phy. in phy mode, this signal is typically tied high or low as needed. the polarity of this signal depends upon the duplex_pol_strap_mii strap. if duplex_pol_strap_mii is 0, a mii_dulpex value of 0 indicates full duplex, and 1 indicates half duplex. if duplex_pol_strap_mii is 1, a mii_dulpex value of 1 indicates full duplex, and 0 indicates half duplex. table 3.4 lan port 0(external mii) pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 34 smsc lan9313/lan9313i datasheet note 3.3 when used as an output, the pin(s) in put buffer(s) and pull-down(s) are disabled. note 3.4 when used as an output, the pin input buffer and pull-up are disabled. note 3.5 an external pull-up is required when the smi or mii management interface is used. this ensures that the idle state of the mdio signal is logic 1. an external pull-up is recommended when the smi or mii management interface is not used to avoid a floating signal. note 3.6 when used as an output, the pin input buffer is disabled. an external pull-down is recommended when the smi or mii management interface is not used to avoid a floating signal. note 3.7 this signal is pulled high through an internal pull-up resistor at all times. table 3.5 dedicated configuration strap pins pin name symbol buffer type description 44 led enable strap led_en is (pu) note 3.8 led enable strap: configures the default value for the led_en bits in the led configuration register (led_cfg) . when latched low, all 8 led/gpio pins are configured as gpios. when latched high, all 8 led/gpio pins are configured as leds. see note 3.9 . 45,47 led function strap led_fun[1:0] is (pu) note 3.8 led function straps: configures the default value for the led_fun bits in the led configuration register (led_cfg) . when latched low, the corresponding bit will be cleared. when latched high, the corresponding bit will be set. see note 3.9 . 56 port 1 auto- mdix enable strap auto_mdix_1 is (pu) note 3.8 port 1 auto-mdix enable strap: configures the default value for the auto -mdix functionality on port 1. when latched low, auto-mdix is disabled. when latched high, auto-mdix is enabled. see note 3.9 . 55 port 1 auto negotiation enable strap auto_neg_1 is (pu) note 3.8 port 1 auto negotiation enable strap: configures the default value for the auto- negotiation (phy_an) enable bit in the phy_basic_ctrl_1 register (see section 13.2.2.1 ). when latched low, auto- negotiation is disabled. when latched high, auto- negotiation is enabled. see note 3.9 . 53 port 1 speed select strap speed_1 is (pu) note 3.8 port 1 speed select strap: configures the default value for the speed select lsb (phy_speed_sel_lsb) bit in the phy_basic_ctrl_1 register (see section 13.2.2.1 ). when latched low, 10 mbps is selected. when latched high, 100 mbps is selected. see note 3.9 . 52 port 1 duplex select strap duplex_1 is (pu) note 3.8 port 1 duplex select strap: configures the default value for the duplex mode (phy_duplex) bit in the phy_basic_ct rl_1 register (see section 13.2.2.1 ). when latched low, half-duplex is selected. when latched high, full-duplex is selected. see note 3.9 . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 35 revision 2.0 (02-14-13) datasheet 51 port 1 backpressure enable strap bp_en_1 is (pu) note 3.8 port 1 backpressure enable strap: configures the default value for the port 1 backpressure enable (bp_en_1) bit of the port 1 manual flow control register (manual_fc_1) . when latched low, backpressure is disabled. when latched high, backpressure is enabled. see note 3.9 . 50 port 1 full- duplex flow control enable strap fd_fc_1 is (pu) note 3.8 port 1 full-duplex flow control enable strap: configures the default value of the port 1 full- duplex transmit flow control enable (tx_fc_1) and port 1 full-duplex receive flow control enable (rx_fc_1) bits in the port 1 manual flow control register (manual_fc_1) , which are used when manual full-duplex control is selected. when latched low, full-duplex pause packet detection and generation are disabled. when latched high, full- duplex pause packet detection and generation are enabled. see note 3.9 . 49 port 1 manual flow control enable strap manual_fc_1 is (pu) note 3.8 port 1 manual flow control enable strap: configures the default value of the port 1 full- duplex manual flow control select (manual_fc_1) bit in the port 1 manual flow control register (manual_fc_1) . when latched low, flow control is determined by auto-negotiation. when latched high, flow control is determined by the port 1 full-duplex transmit flow control enable (tx_fc_1) and port 1 full-duplex receive flow control enable (rx_fc_1) bits. see note 3.9 . 43 port 2 auto- mdix enable strap auto_mdix_2 is (pu) note 3.8 port 2 auto-mdix enable strap: configures the default value for the auto -mdix functionality on port 2. when latched low, auto-mdix is disabled. when latched high, auto-mdix is enabled. see note 3.9 . 42 port 2 auto negotiation enable strap auto_neg_2 is (pu) note 3.8 port 2 auto negotiation enable strap: configures the default value for the auto- negotiation (phy_an) enable bit in the phy_basic_ctrl_2 register (see section 13.2.2.1 ). when latched low, auto- negotiation is disabled. when latched high, auto- negotiation is enabled. see note 3.9 . 41 port 2 speed select strap speed_2 is (pu) note 3.8 port 2 speed select strap: configures the default value for the speed select lsb (phy_speed_sel_lsb) bit in the phy_basic_ctrl_2 register (see section 13.2.2.1 ). when latched low, 10 mbps is selected. when latched high, 100 mbps is selected. see note 3.9 . 38 port 2 duplex select strap duplex_2 is (pu) note 3.8 port 2 duplex select strap: configures the default value for the duplex mode (phy_duplex) bit in the phy_basic_ct rl_2 register (see section 13.2.2.1 ). when latched low, half-duplex is selected. when latched high, full-duplex is selected. see note 3.9 . table 3.5 dedicated configuration strap pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 36 smsc lan9313/lan9313i datasheet 37 port 2 backpressure enable strap bp_en_2 is (pu) note 3.8 port 2 backpressure enable strap: configures the default value for the port 2 backpressure enable (bp_en_2) bit of the port 2 manual flow control register (manual_fc_2) . when latched low, backpressure is disabled. when latched high, backpressure is enabled. see note 3.9 . 36 port 2 full- duplex flow control enable strap fd_fc_2 is (pu) note 3.8 port 2 full-duplex flow control enable strap: configures the default value of the port 2 full- duplex transmit flow control enable (tx_fc_2) and port 2 full-duplex receive flow control enable (rx_fc_2) bits in the port 2 manual flow control register (manual_fc_2) , which are used when manual full-duplex control is selected. when latched low, full-duplex pause packet detection and generation are disabled. when latched high, full- duplex pause packet detection and generation are enabled. see note 3.9 . 35 port 2 manual flow control enable strap manual_fc_2 is (pu) note 3.8 port 2 manual flow control enable strap: configures the default value of the port 2 full- duplex manual flow control select (manual_fc_2) bit in the port 2 manual flow control register (manual_fc_2) . when latched low, flow control is determined by auto-negotiation. when latched high, flow control is determined by the port 2 full-duplex transmit flow control enable (tx_fc_2) and port 2 full-duplex receive flow control enable (rx_fc_2) bits. see note 3.9 . 34 port 0 (external mii) speed select strap speed_mii is (pu) note 3.8 port 0(external mii) speed select strap: together with the duplex_pol_mii and mii_duplex pins, configures the base ability values in the virtual phy auto-negotiation link partner base page ability register (vphy_an_lp_base_ability) . this pin also configures the speed for port 0 when the virtual auto-negotiation fails. when latched low, 10mbps is selected. when latched high, 100mbps is selected. refer to section 13.1.7.6 and ta b l e 1 3 . 6 for more information.see note 3.9 . 32 port 0 (external mii) duplex polarity strap duplex_pol_mii is (pu) note 3.8 port 0(external mii) duplex polarity strap: configures the polarity of the mii_duplex pin for port 0. if mii_duplex = duplex_pol_mii , full-duplex is selected. if mii_duplex != duplex_pol_mii , half-duplex is selected. refer to section 13.1.7.6 and ta b l e 1 3 . 6 for more information.see note 3.9 . table 3.5 dedicated configuration strap pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 37 revision 2.0 (02-14-13) datasheet 31 port 0 (external mii) backpressure enable strap bp_en_mii is (pu) note 3.8 port 0(external mii) backpressure enable strap: configures the default value for the port 0 backpressure enable (bp_en_mii) bit of the port 0(external mii) manual flow control register (manual_fc_mii) . when latched low, backpressure is disabled. when latched high, backpressure is enabled. see note 3.9 . 30 port 0 (external mii) full-duplex flow control enable strap fd_fc_mii is (pu) note 3.8 port 0(external mii) full-duplex flow control enable strap : configures the default of the tx_fc_mii and rx_fc_mii bits in the port 0(external mii) manual flow control register (manual_fc_mii) . when latched low, flow control is disabled on rx/tx. when latched high, flow control is enabled on rx/tx. see note 3.9 . 29 port 0 (external mii) manual flow control enable strap manual_fc_mii is (pu) note 3.8 port 0(external mii) manu al flow control enable strap: configures the default value of the manual_fc_mii bit in the port 0(external mii) manual flow control re gister (manual_fc_mii) . when latched low, flow control is determined by virtual auto-negotiation. when latched high, flow control is determined by tx_fc_mii and rx_fc_mii bits in the port 0(external mii) manual flow control register (manual_fc_mii) . see note 3.9 , and note 3.10 . 26,28 serial management mode strap mngt_mode[1:0] is (pu) note 3.8 serial management mode strap: configures the serial management mode. 00 = unmanaged mode 01 = smi managed mode 10 = i 2 c managed mode 11 = spi managed mode see note 3.9 . 25 mii mode strap mii_mode is (pu) note 3.8 mii mode strap: configures the mode of the external mii port. 0 = mac mode 1 = phy mode see note 3.9 . table 3.5 dedicated configuration strap pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 38 smsc lan9313/lan9313i datasheet note: for more information on conf iguration straps, refer to section 4.2.4, "configuration straps," on page 47 . additional strap pins, which share functi onality with the eeprom pins, are described in table 3.6 . note 3.8 this signal is pulled high through an internal pull-up resistor at all times. note 3.9 configuration strap values are latched on power-on reset or nrst de-assertion. configuration strap pins are identified by an underlined symbol name. some configuration straps can be overridden by values from the eeprom loader. refer to section 4.2.4, "configuration straps," on page 47 for more information. note 3.10 in mac mode, this strap is not used. in this mode, the virtual phy is not applicable, and full-duplex flow control must be controlle d manually by the host, based upon the external phys auto-negotiation results. 95 phy address strap phy_addr_sel is (pu) note 3.8 phy address strap: configures the default mii management address values for the phys (virtual, port 1, and port 2) as detailed in section 7.1.1, "phy addressing," on page 87 . see note 3.9 . table 3.6 eeprom pins pin name symbol buffer type description 96 eeprom microwire data input eedi is (pd) eeprom microwire data input (eedi): in microwire eeprom mode (eeprom_type = 0), this pin is the microwire eeprom serial data input. eeprom i 2 c serial data input/output ee_sda is/od8 eeprom i 2 c serial data input/output (ee_sda): in i 2 c eeprom mode (eeprom_type = 1), this pin is the i 2 c eeprom serial data input/output. note: if i 2 c is selected, an external pull-up is required when using an eeprom and is recommended if no eepr om is attached. table 3.5 dedicated configuration strap pins (continued) pin name symbol buffer type description phy_addr_sel value virtual phy address port 1 phy address port 2 phy address 0 012 1 123 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 39 revision 2.0 (02-14-13) datasheet note 3.11 the is buffer type is valid only during the time specified in section 14.5.2, "reset and configuration strap timing," on page 394 . note 3.12 configuration strap values are latched on power-on reset or nrst de-assertion. configuration strap pins are identified by an underlined symbol name. refer to section 4.2.4, "configuration straps," on page 47 for more information. note 3.13 the is buffer type is valid only during the time specified in section 14.5.2, "reset and configuration strap timing," on page 394 and when in i 2 c mode. 98 eeprom microwire data output eedo o8 eeprom microwire data output: in microwire eeprom mode (eeprom_type = 0), this pin is the microwire eeprom serial data output. note: in i 2 c mode (eeprom_type =1), this pin is not used and is driven low. note: when not using a microwire or i 2 c eeprom, an external pull-down resistor is recommended on this pin. eeprom type strap eeprom_type is note 3.11 eeprom type strap: configures the eeprom type. see note 3.12 0 = microwire mode 1 = i 2 c mode note: when not using a microwire or i 2 c eeprom, an external pull-down resistor is recommended on this pin. 99 eeprom microwire serial clock eeclk o8 eeprom microwire seri al clock (eeclk): in microwire eeprom mode (eeprom_type = 0), this pin is the microw ire eeprom clock output. eeprom i 2 c serial clock ee_scl is/od8 eeprom i 2 c serial clock (ee_scl): in i 2 c eeprom mode (eeprom_type =1), this pin is the i 2 c eeprom clock input /open-drain output. note: if i 2 c is selected, an external pull-up is required when using an eeprom and is recommended if no eepr om is attached. eeprom size strap 1 eeprom_size_1 is note 3.13 eeprom size strap 1: configures the high bit of the eeprom size range as specified in section 8.2, "i2c/microwire ma ster eeprom controller," on page 105 . this bit is not used for i 2 c eeproms. see note 3.12 . 101 eeprom microwire chip select eecs o8 eeprom microwire chip select: in microwire eeprom mode (eeprom_type = 0), this pin is the microwire eeprom chip select output. note: in i 2 c mode (eeprom_type =1), this pin is not used and is driven low. eeprom size strap 0 eeprom_size_0 is note 3.11 eeprom size strap 0: configures the low bit of the eeprom size range as specified in section 8.2, "i2c/microwire ma ster eeprom controller," on page 105 . see note 3.12 . table 3.6 eeprom pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 40 smsc lan9313/lan9313i datasheet note: refer to section chapter 8, "seria l management," on page 105 for additional information regarding the serial management configuration and functionality. table 3.7 serial management pins pin name symbol buffer type description 67 spi slave serial data input si is (pu) spi slave serial data input: in spi slave mode, this pin is the spi serial data input. note: in smi slave and unmanaged modes, this pin is unused and pulled-up internally. i 2 c slave serial data input/output (i 2 c slave mode) sda is/od8 i 2 c serial data input/output: in i 2 c slave mode, this pin is the i 2 c serial data input/output. note: in smi slave and unmanaged modes, this pin is unused and pulled-up internally. 68 spi slave serial data output so o8 spi slave serial data output: in i 2 c slave, smi slave, and unmanaged modes, this pin is not used and is driven low. 69 spi slave chip select nscs is (pu) spi slave chip select: spi slave mode chip select input. when low, the lan9313/lan9313i spi slave is selected for spi transfers. when high, the spi serial data output (so) is 3-stated. in i 2 c slave, smi slave, and unm anaged modes, this pin is not used. 70 spi slave serial clock sck is (pu) spi slave serial clock: in spi slave mode, this pin is the spi clock input. note: in smi slave and unmanaged modes, this pin is unused and pulled-up internally. i 2 c slave serial clock scl is i 2 c slave serial clock: in i 2 c slave mode, this pin is the i 2 c clock input. note: in smi slave and unmanaged modes, this pin is unused and pulled-up internally. table 3.8 miscellaneous pins pin name symbol buffer type description 77-79, 82 general purpose i/o data gpio[11:8] is/od12/ o12 (pu) note 3.14 general purpose i/o data: these general purpose signals are fully programmable as either push-pull outputs, open-drain outputs, or schmitt- triggered inputs by writing the general purpose i/o configuration register (gpio_cfg) and general purpose i/o data & direction register (gpio_data_dir) . for more inform ation, refer to chapter 12, "gpio/led controller," on page 146 . note: the remaining gpio[7:0] pins share functionality with the led output pins, as described in ta b l e 3 . 1 and ta b l e 3 . 2 . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 41 revision 2.0 (02-14-13) datasheet note 3.14 the input buffers are enabled when configured as gpio inputs only. 63 interrupt output irq o8/od8 interrupt output: interrupt request output. the polarity, source and buffer type of this signal is programmable via the interrupt configuration register (irq_cfg) . for more information, refer to chapter 5, "system interrupts," on page 55 . 71 system reset input nrst is (pu) system reset input: this active low signal allows external hardware to reset the lan9313/lan9313i. the lan9313/lan9313i also contains an internal power-on reset circuit. thus, this signal may be left unconnected if an extern al hardware reset is not needed. when used, this signal must adhere to the reset timing requirements as detailed in section 14.5.2, "reset and configuration strap timing," on page 394 . 75 test 1 test1 ai test 1: this pin must be tied to vdd33io for proper operation. 108 test 2 test2 ai test 2: this pin must be tied to vdd33io for proper operation. table 3.9 pll pins pin name symbol buffer type description 107 pll +1.8v power supply vdd18pll p pll +1.8v power supply: this pin must be connected to vdd18core for proper operation. refer to the lan9313/lan9313i reference schematic for additional connection information. 105 crystal input xi iclk crystal input: external 25mhz crystal input. this signal can also be driven by a single-ended clock oscillator. when this method is used, xo should be left unconnected. 106 crystal output xo oclk crystal output: external 25mhz crystal output. table 3.10 core and i/o power and ground pins pin name symbol buffer type description 7,13,21,27, 33,39,46, 54,64,66, 72,73,81, 87,93,100 +3.3v i/o power vdd33io p +3.3v power supply for i/o pins and internal regulator refer to the lan9313/lan9313i reference schematic for additional connection information. table 3.8 miscellaneous pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 42 smsc lan9313/lan9313i datasheet note 3.15 plus external pad for 128-xvtqfp package only 3,14,40,65, 74,88,104 digital core +1.8v power supply output vdd18core p digital core +1.8v power supply output: +1.8v power from the internal core voltage regulator. all vdd18core pins must be tied together for proper operation. refer to the lan9313/lan9313i reference schematic for additional connection information. 18,48,80, 97,112,113, 128 note 3.15 common ground vss p common ground table 3.11 no-connect pins pin name symbol buffer type description 1,2, 57-59, 76,94,102, 103,109 no connect nc - no connect: these pins must be left floating for normal device operation. table 3.10 core and i/o power and ground pins (continued) pin name symbol buffer type description downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 43 revision 2.0 (02-14-13) datasheet chapter 4 clocking, resets, and power management 4.1 clocks the lan9313/lan9313i includes a clock module which provides generation of all system clocks as required by the various sub-modules of the device. the lan9313/lan9313i requires a fixed-frequency 25mhz clock source for use by the internal clock os cillator and pll. this is typically provided by attaching a 25mhz crystal to the xi and xo pins as specified in section 14.6, "clock circuit," on page 398 . optionally, this clock can be provided by driving the xi input pin with a single-ended 25mhz clock source. if a single-ended source is selected, the clock input must run continuously for normal device operation. the internal pll generates a fixe d 200mhz base clock which is used to derive all lan9313/lan9313i sub-system clocks. in addition to the sub-system clocks, the clock mo dule is also responsible for generating the clocks used for the general purpose timer and free-running clock. refer to chapter 11, "general purpose timer & free-running clock," on page 145 for additional details. note: crystal specifications are provided in table 14.10, lan9313/lan9313i crystal specifications, on page 398 . 4.2 resets the lan9313/lan9313i provides multiple hardware and software reset sources, which allow varying levels of the lan9313/lan9313i to be reset. all resets can be categorized into three reset types as described in the following sections: ? chip-level resets power-on reset (por) nrst pin reset ? multi-module resets digital reset (digital_rst) ? single-module resets port 2 phy reset port 1 phy reset virtual phy reset the lan9313/lan9313i supports the use of configuration straps to allow automatic custom configurations of various lan9313/lan9313i parame ters. these configuration strap values are set upon de-assertion of all chip-level resets and can be used to easily set the default parameters of the chip at power-on or pin (nrst) reset. refer to section 4.2.4, "configuration straps," on page 47 for detailed information on the usage of these straps. note: the lan9313/lan9313i eeprom loader is run upon a power-on reset, nrst pin reset, and digital reset. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. table 4.1 summarizes the effect of the various reset sources on the lan9313/lan9313i. refer to the following sections for detailed information on each of these reset types. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 44 smsc lan9313/lan9313i datasheet 4.2.1 chip-level resets a chip-level reset event activates all internal rese ts, effectively resetting t he entire lan9313/lan9313i. configuration straps are latched, and the eeprom loa der is run as a result of chip-level resets. a chip-level reset is initiated by assert ion of any of the following input events: ? power-on reset (por) ? nrst pin reset chip-level reset/configuration comple tion can be determined by first polling the byte order test register (byte_test) . the returned data will be invalid until the serial interface resets are complete. once the returned data is the correct byte ordering value, the serial interface resets have completed. the completion of the entire chip-level reset must then be determined by polling the ready bit of the hardware configuration register (hw_cfg) until it is set. when set, the ready bit indicates that the reset has completed and the device is ready to be accessed. with the exception of the hardware configuration register (hw_cfg) , byte order test register (byte_test) , and reset control register (reset_ctl) , read access to any internal resources is forbidden while the ready bit is cleared. writes to any address are invalid until the ready bit is set. 4.2.1.1 power-on reset (por) a power-on reset occurs whenever power is initiall y applied to the lan9313/lan9313i, or if the power is removed and reapplied to the lan9313/lan9313i. th is event resets all circuitry within the device. configuration straps are latch ed, and the eeprom loader is run as a result of this reset. a por reset typically takes approximately 23ms, plus additional time (91us for i 2 c, 28us for microwire) per byte of data loaded from the eeprom via the eeprom loader. a full eeprom load (64kb for i 2 c, 2kb for microwire) will complete in approximately 6.0 seconds for i 2 c eeprom, and 80ms for microwire eeprom. table 4.1 reset sources and affected lan9313/lan9313i circuitry reset source system clocks/reset/pme sys interrupts switch fabric ethernet phys pmi spi/i 2 c slave smi slave eeprom controller 1588 time stamp gpio/led controller config. straps latched eeprom loader run por xxxxxxxxxxxx nrst pin xxxxxxxxxxxx digital reset xxx xxxxxx x port 2 phy x port 1 phy x virtual phy x downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 45 revision 2.0 (02-14-13) datasheet 4.2.1.2 nrst pin reset driving the nrst input pin low initiates a chip-level reset. this event resets all circuitry within the device. use of this reset input is optional, but when used, it must be driven for the period of time specified in section 14.5.2, "reset and configuration strap timing," on page 394 . configuration straps are latched, and the eeprom loader is run as a result of this reset. a nrst pin reset typically takes approximately 760us, plus additional time (91us for i 2 c, 28us for microwire) per byte of data loaded from the eeprom via the eeprom loader. a full eeprom load (64kb for i 2 c, 2kb for microwire) will complete in approximately 6.0 seconds for i 2 c eeprom, and 58ms for microwire eeprom. note: the nrst pin is pulled-high internally. if un used, this signal can be left unconnected. do not rely on internal pull-up resistors to drive signals external to the device. please refer to section table 3.8, "miscellaneous pins," on page 40 for a description of the nrst pin. 4.2.2 multi-module resets multi-module resets activa te multiple internal rese ts, but do not reset the entire chip. configuration straps are not latched upon multi-module rese ts. a multi-module reset is initiated by assertion of the following: ? digital reset (digital_rst) multi-module reset/configuration comple tion can be determined by first polling the byte order test register (byte_test) . the returned data will be invalid until the serial interface resets are complete. once the returned data is the correct byte ordering value, the serial interface resets have completed. the completion of the entire chip-level reset must then be determined by polling the ready bit of the hardware configuration register (hw_cfg) until it is set. when set, the ready bit indicates that the reset has completed and the device is ready to be accessed. with the exception of the hardware configuration register (hw_cfg) , byte order test register (byte_test) , and reset control register (reset_ctl) , read access to any internal resources is forbidden while the ready bit is cleared. writes to any address are invalid until the ready bit is set. note: the digital reset does not reset register bits designated as nasr. 4.2.2.1 digital reset (digital_rst) a digital reset is performed by se tting the digital_rst bit of the reset control register (reset_ctl) . a digital reset will reset all lan9313/lan9313i sub-modules except the ethernet phys (port 1 phy, port 2 phy, and virtual phy). the eeprom loader wi ll automatically run following this reset. configuration straps are not latched as a result of a digital reset. a digital reset typically takes approximately 760us, plus additional time (91us for i 2 c, 28us for microwire) per byte of data loaded from the eeprom via the eeprom loader. a full eeprom load (64kb for i 2 c, 2kb for microwire) will complete in approximately 6.0 seconds for i 2 c eeprom, and 58ms for microwire eeprom. 4.2.3 single-module resets a single-module reset will reset only the specified module. single-module resets do not latch the configuration straps or initiate the eeprom loader. a single-module reset is initiated by assertion of the following: ? port 2 phy reset ? port 1 phy reset ? virtual phy reset downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 46 smsc lan9313/lan9313i datasheet 4.2.3.1 port 2 phy reset a port 2 phy reset is performed by setting the phy2_rst bit of the reset control register (reset_ctl) or the reset bit in the port x phy basic control register (phy_basic_control_x) . upon completion of the port 2 phy reset, the phy2_rst and reset bits are automatically cleared. no other modules of the lan9313/la n9313i are affected by this reset. in addition to the methods above, the port 2 phy is automatically reset after returning from a phy power-down mode. this reset differs in that the ph y power-down mode reset does not reload or reset any of the phy registers. refer to section 7.2.9, "phy powe r-down modes," on page 99 for additional information. port 2 phy reset completion can be determined by polling the phy2_rst bit in the reset control register (reset_ctl) or the reset bit in the port x phy basic control register (phy_basic_control_x) until it clears. under normal conditions, the phy2_rst and reset bit will clear approximately 110us after the port 2 phy reset occurrence. note: when using the reset bit to reset the port 2 phy, register bits designated as nasr are not reset. refer to section 7.2.10, "phy resets," on page 100 for additional information on port 2 phy resets. 4.2.3.2 port 1 phy reset a port 1 phy reset is performed by setting the phy1_rst bit of the reset control register (reset_ctl) or the reset bit in the port x phy basic control register (phy_basic_control_x) . upon completion of the port 1 phy reset, the phy1_rst and reset bits are automatically cleared. no other modules of the lan9313/la n9313i are affected by this reset. in addition to the methods above, the port 1 phy is automatically reset after returning from a phy power-down mode. this reset differs in that the ph y power-down mode reset does not reload or reset any of the phy registers. refer to section 7.2.9, "phy powe r-down modes," on page 99 for additional information. port 1 phy reset completion can be determined by polling the phy1_rst bit in the reset control register (reset_ctl) or the reset bit in the port x phy basic control register (phy_basic_control_x) until it clears. under normal conditions, the phy1_rst and reset bit will clear approximately 110us after the port 1 phy reset occurrence. note: when using the reset bit to reset the port 1 phy, register bits designated as nasr are not reset. refer to section 7.2.10, "phy resets," on page 100 for additional information on port 1 phy resets. 4.2.3.3 virtual phy reset a virtual phy reset is performed by setting the vphy_rst bit of the reset control register (reset_ctl) or reset in the virtual phy basic control register (vphy_basic_ctrl) . no other modules of the lan9313/lan9313i are affected by this reset. virtual phy reset completion can be determined by polling the vphy_rst bit in the reset control register (reset_ctl) or the reset bit in the virtual phy basic control register (vphy_basic_ctrl) until it clears. under normal conditions, the vphy_rst and reset bit will clear approximately 1us after the vi rtual phy reset occurrence. refer to section 7.3.3, "virtual phy resets," on page 103 for additional information on virtual phy resets. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 47 revision 2.0 (02-14-13) datasheet 4.2.4 configuration straps configuration straps allow various features of the lan9313/lan93 13i to be automatically configured to user defined values. configuration straps can be organized into two main categories: hard-straps and soft-straps. both hard-straps and soft-straps are latched upon power-on reset (por) or pin reset (nrst). the primary difference between these strap types is that soft-strap default values can be overridden by the eeprom loader, while hard-straps cannot. configuration straps which have a corresponding exte rnal pin include internal resistors in order to prevent the signal from floating wh en unconnected. if a particular c onfiguration strap is connected to a load, an external pull-up or pull-down resistor sh ould be used to augment the internal resistor to ensure that it reaches the required voltage level prior to latching. the internal resistor can also be overridden by the addition of an external resistor. note: the system designer must guarantee that co nfiguration strap pins meet the timing requirements specified in section 14.5.2, "reset and conf iguration strap timing," on page 394 . if configuration strap pins ar e not at the correct voltage level prior to being latched, the lan9313/lan9313i may capture incorrect strap values. 4.2.4.1 soft-straps soft-strap values are latched on the release of po r or nrst and are overridden by values from the eeprom loader (when an eeprom is pr esent). these straps are used as direct configuration values or as defaults for cpu registers. some, but not all, soft-straps have an associated pin. those that do not have an associated pin, have a tie off default valu e. all soft-strap values can be overridden by the eeprom loader. table 4.2 provides a list of all soft-straps and their associated pin or default value. straps which have an associated pin are also fully defined in chapter 3, "pin description and configuration," on page 27 . refer to section 8.2.4, "eeprom loader," on page 117 for information on the operation of the eeprom loader and the loading of strap values. upon setting the digit al_rst bit in the reset control register (reset_ctl) or upon issuing a reload command via the eeprom command register (e2p_cmd) , these straps return to their original latched (non-overridden) values if an eepr om is no longer attached or has been erased. the associated pins are not re-sampled. (i.e. the va lue latched on the pin during the last por or nrst will be used, not the value on the pin during the digi tal reset or reload command issuance). if it is desired to re-latch the current configuration st rap pin values, a por or nrst must be issued. table 4.2 soft-strap configuration strap definitions strap name description pin / default value led_en_strap[7:0] led enable straps: configures the default value for the led_en bits in the led configuration register (led_cfg) . a high value configures the associated led/gpio pin as a led. a low value configures the associated led/gpio pin as a gpio. note: one pin configures the default for all 8 led/gpios, but 8 separate bits are loaded by the eeprom loader, allowing in dividual control over each led/gpio. led_en led_fun_strap[1:0] led function straps: configures the def ault value for the led_fun bits in the led configuration register (led_cfg) . when configured low, the corresponding bit will be cleared. when confi gured high, the corresponding bit will be set. led_fun[1:0] downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 48 smsc lan9313/lan9313i datasheet auto_mdix_strap_1 port 1 auto-mdix enable strap: configures the default value for the auto-mdix functionality on port 1 when the amdixctl bit in the port x phy special control/status indication register (phy_special_control_stat_ind_x) is cleared. when configured low, auto-mdix is disabled. when configured high, auto-mdix is enabled. note: if amdixctl is set, this strap had no effect. auto_mdix_1 manual_mdix_strap_1 port 1 manual mdix strap: configures mdi(0) or mdix(1) for port 1 when the auto_mdix_strap_1 is low and the amdixctl bit of the port x phy special control/status indication register (phy_special_control_stat_ind_x) is cleared. 0b autoneg_strap_1 port 1 auto negotiation enable strap: configures the default value for the auto-negotiation (phy_an) enable bit in the phy_basic_ctrl_1 register (see section 13.2.2.1 ). when configured low, auto-negotiation is disabled. when configured high, auto-negotiation is enabled. this strap also affects the default value of the following bits: ? phy_speed_sel_lsb and ph y_duplex bits of the port x phy basic control register (phy_basic_control_x) ? 10base-t full duplex (bit 6) and 10base-t half duplex (bit 5) bits of the port x phy auto-negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. auto_neg_1 speed_strap_1 port 1 speed select strap: configures the default value for the speed select lsb (phy_speed_sel_lsb) bit in the phy_basic_ctrl_1 register (see section 13.2.2.1 ). when configured low, 10 mbps is selected. when configured high, 100 mbps is selected. this strap also affects the default value of the following bits: ? phy_speed_sel_lsb bit of the port x phy basic control register (p hy_basic_control_x) ? 10base-t full duplex (bit 6) and 10base-t half duplex (bit 5) bits of the port x phy auto-negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. speed_1 table 4.2 soft-strap configuration strap definitions (continued) strap name description pin / default value downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 49 revision 2.0 (02-14-13) datasheet duplex_strap_1 port 1 duplex select strap: configures the default value for the duplex mode (phy_duplex) bit in the phy_basic_ctrl_1 register (see section 13.2.2.1 ). when configured low, half-duplex is selected. when configured high, full-duplex is selected. this strap also affects the default value of the following bits: ? phy_duplex bit of the port x phy basic control register (phy_basic_control_x) ? 10base-t full duplex (bit 6) of the port x phy auto- negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. duplex_1 bp_en_strap_1 port 1 backpressure enable strap: configures the default value for the port 1 backpressure enable (bp_en_1) bit of the port 1 manual flow control register (manual_fc_1) . when configured low, backpressure is disabled. when configured high, backpressure is enabled. bp_en_1 fd_fc_strap_1 port 1 full-duplex flow control enable strap: configures the default value of the port 1 full-duplex transmit flow control enable (tx_fc_1) and port 1 full- duplex receive flow control enable (rx_fc_1) bits in the port 1 manual flow control register (manual_fc_1) , which are used when manual full-duplex control is selected. when configured low, full-duplex pause packet detection and generation are disabled. when configured high, full- duplex pause packet detection and generation are enabled. fd_fc_1 manual_fc_strap_1 port 1 manual flow control enable strap: configures the default value of the port 1 full-duplex manual flow control select (manual_fc_1) bit in the port 1 manual flow control register (manual_fc_1) . when configured low, flow control is determined by auto-negotiation (if enabled), and symmetric pause is advertised (bit 10 of the port x phy auto-negotiation advertisement register (phy_an_adv_x) is set). when configured high, flow control is determined by the port 1 full-duplex transmit flow control enable (tx_fc_1) and port 1 full-duplex receive flow control enable (rx_fc_1) bits, and symmetric pause is not advertised (bit 10 of the port x phy auto-negotiation advertisement register (phy_an_adv_x) is cleared). manual_fc_1 auto_mdix_strap_2 port 2 auto-mdix enable strap: configures the default value for the auto-mdix functionality on port 2 when the amdixctl bit in the port x phy special control/status indication register (phy_special_control_stat_ind_x) is cleared. when configured low, auto-mdix is disabled. when configured high, auto-mdix is enabled. note: if amdixctl is set, this strap had no effect. auto_mdix_2 table 4.2 soft-strap configuration strap definitions (continued) strap name description pin / default value downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 50 smsc lan9313/lan9313i datasheet manual_mdix_strap_2 port 2 manual mdix strap: configures mdi(0) or mdix(1) for port 2 when the auto_mdix_strap_2 is low and the amdixctl bit of the port x phy special control/status indication register (phy_special_control_stat_ind_x) is cleared. 0b autoneg_strap_2 port 2 auto negotiation enable strap: configures the default value for the auto-negotiation (phy_an) enable bit in the phy_basic_ctrl_2 register (see section 13.2.2.1 ). when configured low, auto-negotiation is disabled. when configured high, auto-negotiation is enabled. this strap also affects the default value of the following bits: ? phy_speed_sel_lsb and ph y_duplex bits of the port x phy basic control register (phy_basic_control_x) ? 10base-t full duplex (bit 6) and 10base-t half duplex (bit 5) bits of the port x phy auto-negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. auto_neg_2 speed_strap_2 port 2 speed select strap: configures the default value for the speed select lsb (phy_speed_sel_lsb) bit in the phy_basic_ctrl_2 register (see section 13.2.2.1 ). when configured low, 10 mbps is selected. when configured high, 100 mbps is selected. this strap also affects the default value of the following bits: ? phy_speed_sel_lsb bit of the port x phy basic control register (p hy_basic_control_x) ? 10base-t full duplex (bit 6) and 10base-t half duplex (bit 5) bits of the port x phy auto-negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. speed_2 table 4.2 soft-strap configuration strap definitions (continued) strap name description pin / default value downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 51 revision 2.0 (02-14-13) datasheet duplex_strap_2 port 2 duplex select strap: configures the default value for the duplex mode (phy_duplex) bit in the phy_basic_ctrl_2 register (see section 13.2.2.1 ). when configured low, half-duplex is selected. when configured high, full-duplex is selected. this strap also affects the default value of the following bits: ? phy_duplex bit of the port x phy basic control register (phy_basic_control_x) ? 10base-t full duplex (bit 6) of the port x phy auto- negotiation advertisement register (phy_an_adv_x) ? mode[2:0] bits of the port x phy special modes register (phy_special_modes_x) refer to the respective register definition sections for additional information. duplex_2 bp_en_strap_2 port 2 backpressure enable strap: configures the default value for the port 2 backpressure enable (bp_en_2) bit of the port 2 manual flow control register (manual_fc_2) . when configured low, backpressure is disabled. when configured high, backpressure is enabled. bp_en_2 fd_fc_strap_2 port 2 full-duplex flow control enable strap: configures the default value of the port 2 full-duplex transmit flow control enable (tx_fc_2) and port 2 full- duplex receive flow control enable (rx_fc_2) bits in the port 2 manual flow control register (manual_fc_2) , which are used when manual full-duplex control is selected. when configured low, full-duplex pause packet detection and generation are disabled. when configured high, full- duplex pause packet detection and generation are enabled. fd_fc_2 manual_fc_strap_2 port 2 manual flow control enable strap: configures the default value of the port 2 full-duplex manual flow control select (manual_fc_2) bit in the port 2 manual flow control register (manual_fc_2) . when configured low, flow control is determined by auto-negotiation (if enabled), and symmetric pause is advertised (bit 10 of the port x phy auto-negotiation advertisement register (phy_an_adv_x) is set). when configured high, flow control is determined by the port 2 full-duplex transmit flow control enable (tx_fc_2) and port 2 full-duplex receive flow control enable (rx_fc_2) bits, and symmetric pause is not advertised (bit 10 of the port x phy auto-negotiation advertisement register (phy_an_adv_x) is cleared). manual_fc_2 speed_strap_mii port 0(external mii) speed select strap: together with the duplex_pol_strap_mii and mii_duplex pins, configures the base ability values in the virtual phy auto- negotiation link partner base page ability register (vphy_an_lp_base_ability) . this pin configures the speed for port 0 when the virtual auto-negotiation fails. when configured low, 10mbps is selected. when configured high, 100mbps is selected. refer to section 13.1.7.6 and table 13.6 for more information. speed_mii table 4.2 soft-strap configuration strap definitions (continued) strap name description pin / default value downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 52 smsc lan9313/lan9313i datasheet 4.2.4.2 hard-straps hard-straps are latched upon power-on reset (por) or pin reset (nrst) only. unlike soft-straps, hard-straps always have an associated pin and cannot be overridden by the eeprom loader. these straps are used as either direct configuration values or as register defaults. table 4.3 provides a list of all hard-straps and their associated pin. these straps, along with their pin assignments are also fully defined in chapter 3, "pin description and configuration," on page 27 . duplex_pol_strap_mii port 0(external mii) duplex polarity strap: configures the polarity of the mii_duplex pin for port 0. if mii_duplex = duplex_pol_mii , full-duplex is selected. if mii_duplex != duplex_pol_mii , half-duplex is selected. refer to section 13.1.7.6 and table 13.6 for more information. duplex_pol_mii bp_en_strap_mii port 0(external mii) backpressure enable strap: configures the default value for the port 0 backpressure enable (bp_en_mii) bit of the port 0(external mii) manual flow control register (manual_fc_mii) . when configured low, backpressure is disabled. when configured high, backpressure is enabled. bp_en_mii fd_fc_strap_mii port 0(external mii) full-duplex flow control enable strap : configures the defaul t of the tx_fc_mii and rx_fc_mii bits in the port 0(external mii) manual flow control register (manual_fc_mii) which are used when manual full-duplex flow control is selected. when configured low, flow control is disabled on rx/tx. when configured high, flow control is enabled on rx/tx. fd_fc_mii manual_fc_strap_mii port 0(external mii) manual flow control enable strap: configures the default value of the manual_fc_mii bit in the port 0(external mii) manual flow control register (manual_fc_mii) . when configured low, flow control is determined by virtual auto-negotiation (if enabled). when configured high, flow control is determined by tx_fc_mii and rx_fc_mii bits in the port 0(external mii) manual flow control register (manual_fc_mii) . note: in mac mode, this strap is not used. in this mode, the virtual phy is not applicable, and full-duplex flow control must be c ontrolled manually by the host, based upon the external phys auto- negotiation results. manual_fc_mii sqe_test_disable_strap_mii sqe heartbeat disable strap: configures the signal quality error (heartbeat) test function by controlling the default value of the sqeoff (bit 0) of the virtual phy special control/status register (vphy_special_control_status) . when configured low, sqeoff defaults to 0 and sqe test is enabled. when configured high, sqeoff defaults to 1 and sqe test is disabled. 0b table 4.2 soft-strap configuration strap definitions (continued) strap name description pin / default value downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 53 revision 2.0 (02-14-13) datasheet 4.3 power management the lan9313/lan9313i port 1 and port 2 phys support several power management and wakeup features. 4.3.1 port 1 & 2 phy power management the port 1 & 2 phys provide independent gene ral power-down and energy-detect power-down modes which reduce phy power consumption. general power-down mode provides power savings by table 4.3 hard-strap configuration strap definitions strap name description pin mngt_mode_strap[1:0] serial management mode strap: configures the default serial management mode. 00 = unmanaged mode 01 = smi managed mode 10 = i 2 c managed mode 11 = spi managed mode refer to section 2.3, "modes of operation," on page 24 for additional information on the various modes of the lan9313/lan9313i. mngt_mode[1:0] eeprom_type_strap eeprom type strap: configures the eeprom type. 0 = microwire mode 1 = i 2 c mode eeprom_type eeprom_size_strap[1:0] eeprom size strap [1:0]: configures the eeprom size range as specified in section 8.2, "i2c/microwire master eeprom controller," on page 105 . eeprom_size_[1:0] mii_mode_strap mii mode strap: configures the default mode of the external mii port. 0 = mac mode 1 = phy mode refer to section 2.3, "modes of operation," on page 24 for additional information on the various modes of the lan9313/lan9313i. mii_mode phy_addr_sel_strap phy address select strap: configures the default mii management address values for the phys and virtual phy as detailed in section 7.1.1, "phy addressing," on page 87 . phy_addr_sel phy_addr_sel_strap value virtual phy address port 1 phy address port 2 phy address 0 012 1 123 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 54 smsc lan9313/lan9313i datasheet powering down the entire phy, except the phy management control interface. general power-down mode must be manually enabled and disabled as described in section 7.2.9.1, "p hy general power- down," on page 100 . in energy-detect power-down mode, the phy will re sume from power-down when energy is seen on the cable (typically from link pulses). if th e energyon interrupt (i nt7) of either phys port x phy interrupt mask register (phy_interrupt_mask_x) is unmasked, then the corresponding phy will generate an interrupt. these interrupts are reflected in the interrupt status register (int_sts) bit 27 (phy_int2) for the port 2 phy, and bit 26 (phy_int1) for the port 1 phy. these interrupts can be used to trigger the irq interrupt output pin, as described in section 5.2.3, "ethernet phy interrupts," on page 58 . refer to section 7.2.9.2, "phy energy detect power-down," on page 100 for details on the operation and configuration of th e phy energy-detect power-down mode. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 55 revision 2.0 (02-14-13) datasheet chapter 5 system interrupts 5.1 functional overview this chapter describes the system interr upt structure of the lan9313/lan9313i. the lan9313/lan9313i provides a multi-tier programmable interrupt structure which is controlled by the system interrupt controller. the programmable system interrupts are generated internally by the various lan9313/lan9313i sub-modules and can be configured to generate a single external host interrupt via the irq interrupt output pin. the prog rammable nature of the host interrupt provides the user with the ability to optimiz e performance dependent upon the application requirements. the irq interrupt buffer type, polarity, and de-assertion interval are modifiable. the irq interrupt can be configured as an open-drain output to facilitate the s haring of interrupts with other devices. all internal interrupts are maskable and capable of triggering the irq interrupt. 5.2 interrupt sources the lan9313/lan9313i is capable of gener ating the following interrupt types: ? 1588 time stamp interrupts (port 2,1,0 and gpio 9,8) ? switch fabric interrupts (buffer manager, switch engine, and port 2,1,0 macs) ? ethernet phy interrupts (port 1,2 phys) ? gpio interrupts (gpio[11:0]) ? general purpose timer interrupt (gpt) ? software interrupt (general purpose) ? device ready interrupt all interrupts are accessed and configured via registers arranged into a multi-tier, branch-like structure, as shown in figure 5.1 . at the top level of the lan9313/la n9313i interrupt structure are the interrupt status register (int_sts) , interrupt enable register (int_en) , and interrupt configuration register (irq_cfg) . the interrupt status register (int_sts) and interrupt enable register (int_en) aggregate and enable/disable all interrupts from the variou s lan9313/lan9313i sub-modules, combining them together to create the irq in terrupt. these registers provide direct interrupt access/configuration to the general purpose timer, software, and device ready interrupts. these interrupts can be monitored, enabled/disabled, and cleared, directly within t hese two registers. in addition, interrupt event indications are provided for the 1588 time stamp, switch fabric, port 1 & 2 ethernet phys, and gpio interrupts. these interrupts differ in that the inte rrupt sources are generated and cleared in other sub- block registers. the int_sts regi ster does not provide details on wh at specific event within the sub- module caused the interrupt, and requires the soft ware to poll an additional sub-module interrupt register (as shown in figure 5.1 ) to determine the exact interrupt source and clear it. for interrupts which involve multiple registers, only after the in terrupt has been serviced and cleared at its source will it be cleared in the int_sts register. the interrupt configuration register (irq_cfg) is responsible for enabling/disabling the irq interrupt output pin as well as configuring its properties. th e irq_cfg register allows the modification of the irq pin buffer type, polarity, and de-assertion in terval. the de-assertion timer guarantees a minimum interrupt de-assertion period for the irq output a nd is programmable via the int_deas field of the interrupt configuration register (irq_cfg) . a setting of all zeros disables the de-assertion timer. the de-assertion interval starts when the irq pin de-asserts, regardless of the reason. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 56 smsc lan9313/lan9313i datasheet figure 5.1 functional interrupt register hierarchy int_cfg int_sts int_en top level interrupt registers (system csrs) 1588_int_sts_en 1588 time stamp interrupt register bit 29 (1588_evnt) of int_sts register phy_interrupt_source_2 phy_interrupt_mask_2 port 2 phy interrupt registers bit 27 (phy_int2) of int_sts register phy_interrupt_source_1 phy_interrupt_mask_1 port 1 phy interrupt registers bit 26 (phy_int1) of int_sts register sw_imr sw_ipr switch fabric interrupt registers bit 28 (switch_int) of int_sts register bm_imr bm_ipr buffer manager interrupt registers bit 6 (bm) of sw_ipr register swe_imr swe_ipr switch engine interrupt registers bit 5 (swe) of sw_ipr register mac_imr_[2,1,mii] mac_ipr_[2,1,mii] port [2,1,0] mac interrupt registers bits [2,1,0] (mac_[2,1,mii]) of sw_ipr register gpio_int_sts_en gpio interrupt register bit 12 (gpio) of int_sts register downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 57 revision 2.0 (02-14-13) datasheet the following sections detail each category of interrupts and their related registers. refer to chapter 13, "register descriptions," on page 150 for bit-level definitions of all interrupt registers. 5.2.1 1588 time stamp interrupts multiple 1588 time stamp interrupt sources are provided by the lan9313/lan9313i. the top-level 1588_evnt (bit 29) of the interrupt status register (int_sts) provides indication that a 1588 interrupt event occurred in the 1588 interrupt status and enable register (1588_int_sts_en) . the 1588 interrupt status and enable register (1588_int_sts_en) provides enabling/disabling and status of all 1588 interrupt conditions. these include tx/rx 1588 clock capture indication on ports 2,1,0, 1588 clock capture for gp io[8:9] events, as well as 1588 timer interrupt indication. in order for a 1588 interrupt event to trigger the ex ternal irq interrupt pin, the desired 1588 interrupt event must be enabled in the 1588 interrupt status and enable register (1588_int_sts_en) , bit 29 (1588_evnt_en) of the interrupt enable register (int_en) must be set, and irq output must be enabled via bit 8 (irq_en) of the interrupt configurati on register (irq_cfg) . for additional details on the 1588 time stamp interrupts, refer to section 10.6, "ieee 1588 interrupts," on page 144 . 5.2.2 switch fabric interrupts multiple switch fabric interrupt sources are provided by the la n9313/lan9313i in a three-tiered register structure as shown in figure 5.1 . the top-level switch_ int (bit 28) of the interrupt status register (int_sts) provides indication that a switch fa bric interrupt event occurred in the switch engine interrupt pending register (swe_ipr) . in turn, the switch engine interrupt pending register (swe_ipr) and switch engine interrupt mask register (swe_imr) provide status and enabling/disabling of all switch fabric sub-modules interrupts (buffer manager, switch engine, and port 2,1,0 macs). the low-level switch fabric sub-module interrupt pending and mask registers of the buffer manager, switch engine, and port 2,1,0 macs provide multiple interrupt sources from their respective sub- modules. these low-level registers provide the following interrupt sources: ? buffer manager ( buffer manager interrupt mask register (bm_imr) and buffer manager interrupt pending register (bm_ipr) ) status b pending status a pending ? switch engine ( switch engine interrupt mask register (swe_imr) and switch engine interrupt pending register (swe_ipr) ) interrupt pending ? port 2,1,0 macs ( port x mac interrupt mask register (mac_imr_x) and port x mac interrupt pending register (mac_ipr_x) ) no currently supported interrupt sources. t hese registers are reserved for future use. in order for a switch fabric interrupt event to tri gger the external irq interr upt pin, the following must be configured: ? the desired switch fabric sub-module interrupt event must be enabled in the corresponding mask register ( buffer manager interrupt mask register (bm_imr) for the buffer manager, switch engine interrupt mask register (swe_imr) for the switch engine, and/or port x mac interrupt mask register (mac_imr_x) for the port 2,1,0 macs) ? the desired switch fabric sub-module interrupt event must be enabled in the switch engine interrupt mask register (swe_imr) ? bit 28 (switch_int_en) of the interrupt enable register (int_en) must be set ? irq output must be enabled via bit 8 (irq_en) of the interrupt configuration register (irq_cfg) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 58 smsc lan9313/lan9313i datasheet for additional details on the switch fabric interrupts, refer to section 6.6, "switch fabric interrupts," on page 86 . 5.2.3 ethernet phy interrupts the port 1 and port 2 phys each provide a set of identical interrupt sources. the top-level phy_int1 (bit 26) and phy_int2 (bit 27) of the interrupt status register (int_sts) provides indication that a phy interrupt event occurred in the port x phy interrupt source flags register (phy_interrupt_source_x) . port 1 and port 2 phy interrupts are enabled/disabled via their respective port x phy interrupt mask register (phy_interrupt_mask_x) . the source of a phy interrupt can be determined and cleared via the port x phy interrupt source flag s register (phy_interrupt_source_x) . the port 1 and port 2 phys are each capable of generating unique interrupts based on the following events: ? energyon activated ? auto-negotiation complete ? remote fault detected ? link down (link status negated) ? auto-negotiation lp acknowledge ? parallel detection fault ? auto-negotiation page received in order for a port 1 or port 2 interrupt event to tr igger the external irq inte rrupt pin, the desired phy interrupt event must be enabled in the corresponding port x phy interrupt mask register (phy_interrupt_mask_x) , the phy_int1(port 1 phy) and/or phy_int2(port 2 phy) bits of the interrupt enable register (int_en) must be set, and irq output must be enabled via bit 8 (irq_en) of the interrupt configurati on register (irq_cfg) . for additional details on the ethernet phy interrupts, refer to section 7.2.8.1, "phy interrupts," on page 99 . 5.2.4 gpio interrupts each gpio[11:0] of the lan9313/lan9313i is prov ided with its own interrupt. the top-level gpio (bit 12) of the interrupt status register (int_sts) provides indication that a gpio interrupt event occurred in the general purpose i/o interrupt status and enable register (gpio_int_sts_en) . the general purpose i/o interrupt status and e nable register (gpio_int_sts_en) provides enabling/disabling and status of each gpio[11:0] interrupt. in order for a gpio interrupt event to trigger the ex ternal irq interrupt pin, the desired gpio interrupt must be enabled in the general purpose i/o interrupt status and enable register (gpio_int_sts_en) , bit 12 (gpio_en) of the interrupt enable register (int_en) must be set, and irq output must be enabled via bit 8 (irq_en) of the interrupt configuration register (irq_cfg) . for additional details on the gpio interrupts, refer to section 12.2.2, "gpio interrupts," on page 147 . 5.2.5 general purpose timer interrupt a general purpose timer (gpt) interr upt is provided in the top-level interrupt status register (int_sts) and interrupt enable register (int_en) (bit 19). this interrupt is issued when the general purpose timer configuration register (gpt_cfg) wraps past zero to ffffh, and is cleared when bit 19 of the interrupt status register (int_sts) is written with 1. in order for a general purpose timer interrupt event to trigger the external irq interrupt pin, the gpt must be enabled via the bit 29 (timer_en) in the general purpose timer configuration register (gpt_cfg) , bit 19 of the interrupt enable register (int_en) must be set, and irq output must be enabled via bit 8 (irq_en) of the interrupt configurati on register (irq_cfg) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 59 revision 2.0 (02-14-13) datasheet for additional details on the general purpose timer, refer to section 11.1, "general purpose timer," on page 145 . 5.2.6 software interrupt a general purpose software interrupt is provided in the top level interrupt status register (int_sts) and interrupt enable register (int_en) . the sw_int interrupt (bit 31) of the interrupt status register (int_sts) is generated when sw_i nt_en (bit 31) of the interrupt enable register (int_en) is set. this interrupt provides an easy way for software to generate an interrupt, and is designed for general software usage. 5.2.7 device ready interrupt a device ready interrupt is provided in the top-level interrupt status register (int_sts) and interrupt enable register (int_en) . the ready interrupt (bit 30) of the interrupt status register (int_sts) indicates that the lan9313/lan9313i is ready to be accessed after a power-up or reset condition. writing a 1 to this bit in the interrupt status register (int_sts) will clear it. in order for a device ready interrupt event to trigger the external irq interrupt pin, bit 30 of the interrupt enable register (int_en) must be set, and irq output must be enabled via bit 8 (irq_en) of the interrupt configuration register (irq_cfg) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 60 smsc lan9313/lan9313i datasheet chapter 6 switch fabric 6.1 functional overview at the core of the lan9313/lan9313i is the high performance, high efficiency 3 port ethernet switch fabric. the switch fabric contains a 3 port vlan layer 2 switch engine that supports untagged, vlan tagged, and priority tagged frames. the switch fabric provides an extensive feature set which includes spanning tree protocol support, multicast packe t filtering and quality of service (qos) packet prioritization by vlan tag, dest ination address, port default valu e or diffserv/tos, allowing for a range of prioritization implementations. 32k of buff er ram allows for the storage of multiple packets while forwarding operations are completed, and a 1k entry forwarding table provides room for mac address forwarding tables. each port is allocated a cluster of 4 dynamic qos queues which allow each queue size to grow and shrink with traffic, effectively utilizing all available memory. this memory is managed dynamically via the buffer manager block with in the switch fabric. a ll aspects of the switch fabric are managed via the switch f abric configuration and status regi sters (csr), which are indirectly accessible via the system cont rol and status registers. the switch fabric consists of four major block types: ? switch fabric csrs - these registers provide access to va rious switch fabric parameters for configuration and monitoring. ? 10/100 ethernet macs - a total of three macs are included in the switch fabric which provide basic 10/100 ethernet functionality for each switch fabric port. ? switch engine (swe) - this block is the core of the switch fabric and provides vlan layer 2 switching for all three switch ports. ? buffer manager (bm) - this block provides control of the free buffer space, transmit queues, and scheduling. refer to figure 2.1 internal lan9313/lan9313i block diagram on page 20 for details on the interconnection of the switch fabric blocks within the lan9313/lan9313i. 6.2 switch fabric csrs the switch fabric csrs provide regi ster level access to the various parameters of the switch fabric. switch fabric related registers can be classified into two main categories based upon their method of access: direct and indirect. the directly accessi ble switch fabric registers are part of the main system csrs of the lan9313/lan9313i and are detailed in section 13.1.5, "switch fabric," on page 196 . these registers provide switch fabric manual flow control (ports 0-2), data/command registers (for access to the indirect switch fabric registers), and switch mac address configuration. the indirectly accessible switch f abric registers reside within the switch fabric and must be accessed indirectly via the switch fabric csr interface data register (switch_csr_data) and switch fabric csr interface command register (switch_csr_cmd) , or the set of switch fabric csr interface direct data register (switch_csr_direct_data) . the indirectly accessible switch fabric csrs provide full access to the many configurable para meters of the switch engine, buffer manager, and each switch port. the switch fabric csrs are detailed in section 13.3, "switch fabric control and status registers," on page 257 . for detailed descriptions of all switch fabric related registers, refer to chapter 13, "register descriptions," on page 150 . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 61 revision 2.0 (02-14-13) datasheet 6.2.1 switch fabric csr writes to perform a write to an individual switch fabric re gister, the desired data must first be written into the switch fabric csr interface data register (switch_csr_data) . the write cycle is initiated by performing a single write to the switch fabric csr interface command register (switch_csr_cmd) with csr_busy (bit 31) set, the csr_address field (bits 15:0) set to the desired register address, the r_nw (bit 30) cleared, the auto_inc and auto_dec fields cleared, and the desired csr byte enable bits selected (bits 19:16). the completion of the write cycle is indicated by the clearing of the csr_busy bit. a second write method may be used which utilizes the auto increment/decrement function of the switch fabric csr interface command register (switch_csr_cmd) for writing sequential register addresses. when using this method, the switch fabric csr in terface command register (switch_csr_cmd) must first be written with the au to increment(auto_inc) or auto decrement(auto_dec) bit set, the csr_address fiel d written with th e desired register address, the r_nw bit cleared, and the desired csr byte enable bi ts selected (typically all set). the write cycles are then initiated by writing the desired data into the switch fabric csr interface data register (switch_csr_data) . the completion of the write cycle is indicated by the clearing of the csr_busy bit, at which time the address in the switch fabric csr interface command register (switch_csr_cmd) is incremented or decremented accordingly. the user may then initiate a subsequent write cycle by writing the desired data into the switch fabric csr in terface data register (switch_csr_data) . the third write method is to use the direct data range write function. writes within the switch fabric csr interface direct data register (switch_csr_direct_data) address range automatically set the appropriate register address, set all four byte enable bits (csr_be[3:0]), clears the r_nw bit, and sets the csr_busy bit of the switch fabric csr interface command register (switch_csr_cmd) . the completion of the write cycle is indicated by the clearing of the csr_busy bit. since the address range of the switch fabric csrs exceeds that of the switch fabric csr interface direct data regi ster (switch_csr_direct_data) address range, a sub-set of the switch fabric csrs are mapped to the switch fabric csr interface direct data register (switch_csr_direct_data) address range as detailed in table 13.3, switch fabric csr to switch_csr_direct_data address range map, on page 208 . figure 6.1 illustrates the process required to perform a switch fabric csr write. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 62 smsc lan9313/lan9313i datasheet 6.2.2 switch fabric csr reads to perform a read of an individual s witch fabric register, the read cycl e must be initiated by performing a single write to the switch fabric csr interface co mmand register (switch_csr_cmd) with csr_busy (bit 31) set, the csr_address field (bits 15:0) set to the desired register address, the r_nw (bit 30) set, and the auto_inc and auto_dec fields cleared. valid data is available for reading when the csr_busy bit is cleared, indicating that the data can be read from the switch fabric csr interface data register (switch_csr_data) . a second read method may be used which utilizes the auto increment/decrement function of the switch fabric csr interface command register (switch_csr_cmd) for reading sequential register addresses. when using this method, the switch fabric csr in terface command register (switch_csr_cmd) must first be written with the au to increment(auto_inc) or auto decrement(auto_dec) bit set, th e csr_address field written with the desired register address, and the r_nw bit set. the completion of a read cycle is i ndicated by the cleari ng of the csr_busy bit, at which time the data can be read from the switch fabric csr in terface data register (switch_csr_data) . when the data is read, the address in the switch fabric csr interface command register (switch_csr_cmd) is incremented or decremented accordingly, and another read cycle is started automatically. the user shou ld clear the auto_inc a nd auto_dec bits before reading the last data to avoid an unintended read cycle. figure 6.2 illustrates the process required to perform a switch fabric csr read. figure 6.1 switch fabric csr write access flow diagram idle write data register write command register read command register csr_busy = 0 csr write csr_busy = 1 idle write data register write command register read command register csr_busy = 0 csr write auto increment / decrement csr_busy = 1 idle write direct data register range read command register csr_busy = 0 csr write direct address csr_busy = 1 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 63 revision 2.0 (02-14-13) datasheet 6.2.3 flow control enable logic each switch fabric port (0,1,2) is provided wit h two flow control enable inputs per port, one for transmission and one for reception. flow control on transmission allows the transmitter to generate back pressure in half-duplex mode, and pause packets in full-duplex. flow control in reception enables the reception of pause packets to pause transmissions. the state of these enables is based on the state of the ports duplex and auto-negotiation settings and the values of the corresponding manual flow control register ( port 1 manual flow control register (manual_fc_1) , port 2 manual flow control register (manual_fc_2) , or port 0(external mii) manual flow control register (manual_fc_mii) ). ta b l e 6 . 1 details the switch fabric flow control enable logic. when in half-duplex mode, the transmit flow contro l (back pressure) enable is determined directly by the bp_en_x bit of the ports manual flow control register. when auto-negotiation is disabled, or the manual_fc_x bit of the ports manual flow control regi ster is set, the switch port flow control enables during full-duplex are determined by the tx_fc_x a nd rx_fc_x bits of the ports manual flow control figure 6.2 switch fabric cs r read access flow diagram idle write command register read command register read data register csr_busy = 0 csr read csr_busy = 1 idle write command register read command register csr_busy = 0 csr read auto increment / decrement csr_busy = 1 write command register read data register last data? yes no read data register downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 64 smsc lan9313/lan9313i datasheet register. when auto-negotiation is enabled and the manual_fc_x bit is cleared, the switch port flow control enables during full-duplex are determined by auto-negotiation. note: the flow control values in the port x phy auto-negotiation advertisement register (phy_an_adv_x) and virtual phy auto-negotiation advertisement register (vphy_an_adv) are not affected by the values of the manual flow control register. refer to section 7.2.5.1, "phy pause flow control," on page 97 and section 7.3.1.3, "virtual phy pause flow control," on page 103 for additional information on phy and virtual phy flow control settings respectively. note 6.1 if auto-negotiation is enabled and complete, bu t the link partner is not auto-negotiation capable, half-duplex is forced via the parallel detect function. note 6.2 for the port 1 and port 2 phys, these are the bits from the port x phy auto-negotiation advertisement register (phy_an_adv_x) and port x phy auto-negotiation link partner base page ability register (phy_an_lp_base_ability_x) . for the virtual phy, these are the local/partner swapped ou tputs from the bits in the virtual phy auto-negotiation advertisement register (vphy_an_adv) and virtual phy auto-negotiation link partner base page ability register (vphy_an_lp_base_ability) . refer to section 7.3.1, "virtual phy auto-negotiation," on page 101 for more information. table 6.1 switch fabric flow control enable logic case manual_fc_x an enable an complete lp an able duplex an pause advertisement ( note 6.2 ) an asym pause advertisement ( note 6.2 ) lp pause ability ( note 6.2 ) lp asym pause ability ( note 6.2 ) rx flow control enable tx flow control enable -1x x xh a l f xxxx0 bp_en_x - x0x xh a l f xxxx0 bp_en_x -1x x xf u l l xxxx rx_fc_x tx_fc_x - x0x xf u l l xxxx rx_fc_x tx_fc_x 10 1 0 x x xxxx0 0 20 1 1 0h a l f ( note 6.1 ) xxxx0 bp_en_x 30 1 1 1h a l f xxxx0 bp_en_x 40 1 1 1f u l l 0 0 x x 0 0 50 1 1 1f u l l 0 1 0 x 0 0 60 1 1 1f u l l 011000 70 1 1 1f u l l 011101 80 1 1 1f u l l 1 0 0 x 0 0 90 1 1 1f u l l 1x1x11 10 0 1 1 1f u l l 110000 11 0 1 1 1f u l l 110110 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 65 revision 2.0 (02-14-13) datasheet per ta b l e 6 . 1 , the following cases are possible: ? case 1 - auto-negotiation is still in progress. since t he result is not yet established, flow control is disabled. ? case 2 - auto-negotiation is enabled and unsuccessfu l (link partner not auto-negotiation capable). the link partner ability is undefined, effectively a dont-care value, in this case. the duplex setting will default to half-duplex in this case. flow control is determined by the bp_en_x bit. ? case 3 - auto-negotiation is enabled and successful with half-duplex as a result. the link partner ability is undefined since it only applies to full-duple x operation. flow control is determined by the bp_en_x bit. ? cases 4-11 -auto-negotiation is enabled and successful with full-duplex as the result. in these cases, the advertisement registers and the link partner ability controls the rx and tx enables. these cases match ieee 802.3 annex 28b.3. ? cases 4,5,6,8,10 - no flow control enabled ? case 7 - asymmetric pause towards partner (away from switch port) ? case 9 - symmetric pause ? case 11 - asymmetric pause from partner (towards switch port) 6.3 10/100 ethernet macs the switch fabric contains three 10/100 mac blocks , one for each switch port (0,1,2). the 10/100 mac provides the basic 10/100 ethernet functionality, including transmission deferral and collision back- off/retry, receive/transmit fcs checking and genera tion, receive/transmit pause flow control, and transmit back pressure. the 10/100 mac also includes rx and tx fifos and per port statistic counters. 6.3.1 receive mac the receive mac (ieee 802.3) sublayer decomposes ethernet pa ckets acquired via the internal mii interface by stripping off the preamble sequence and start of frame delimiter (sfd). the receive mac checks the fcs, the mac control type, and the by te count against the drop conditions. the packet is stored in the rx fifo as it is received. the receive mac determines the validity of each rece ived packet by checking the type field, fcs, and oversize or undersize conditions. all bad packets will be either immediately dropped or marked (at the end) as bad packets. oversized packets are normally truncated at 1519 or 1523 (vlan tagged) octets and marked as erroneous. the mac can be configured to accept packets up to 2048 octets (inclusive), in which case the oversize packets are truncated at 2048 bytes and marked as erroneous. undersized packets are defined as packets with a length less than the minimum packet size. the minimum packet size is defined to be 64 by tes, exclusive of pr eamble sequence and sfd. the fcs and length/type fields of the frame is checked to detect if the packet has a valid mac control frame. when the mac receives a mac control fr ame with a valid fcs and determines the operation code is a pause command (flow control frame), the mac will load its internal pause counter with the number_of_slots variable from the mac control frame just received. anytime the internal pause counter is zero, the transmit mac will be allowed to transmit (xon). if the internal pause counter is not zero, the receive mac will not allow the transmit mac to transmit (xoff). when the transmit mac detects an xoff condition it will c ontinue to transmit the current packet, terminating transmission after the current packet has been transmitted until receivin g the xon condition from the receive mac. the pause counter will begin to decrement at then end of the current transmission, or immediately if no transmission is underway. if another pause command is received while the transmitter is already in pause, the new pause time indicated by the flow control packet will be loaded into the pause counter. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 66 smsc lan9313/lan9313i datasheet the pause function is enabled by either au to-negotiation, or manually as discussed in section 6.2.3, "flow control enable logic," on page 63 . pause frames are consumed by the mac and not sent to the switch engine. non-pause control fram es are optionally filtered or forwarded. when the receive fifo is full and additional data c ontinues to be received, an overrun condition occurs and the frame is discarded (fifo space recovered) or marked as a bad frame. the receive mac can be disabled from receiving a ll frames by clearing the rx enable bit of the port x mac receive configuration register (mac_rx_cfg_x) . the size of the rx fifo is 256 bytes. if a bad pa cket with less than 64 bytes is received, it will be flushed from the fifo aut omatically and the fifo space recovered. packets equal to or larger than 64 bytes with an error will be marked and reported to the switch engine. the switch engine will subsequently drop the packet. 6.3.1.1 receive counters the receive mac gathers statistics on each packet an d increments the related counter registers. the following receive counters are supported fo r each switch fabric port. refer to table 13.12, indirectly accessible switch control and status registers, on page 257 and section 13.3.2.3 through section 13.3.2.22 for detailed descriptions of these counters. ? total undersized packets ( section 13.3.2.3, on page 274 ) ? total packets 64 bytes in size ( section 13.3.2.4, on page 275 ) ? total packets 65 through 127 bytes in size ( section 13.3.2.5, on page 276 ) ? total packets 128 through 255 bytes in size ( section 13.3.2.6, on page 277 ) ? total packets 256 through 511 bytes in size ( section 13.3.2.7, on page 278 ) ? total packets 512 through 1023 bytes in size ( section 13.3.2.8, on page 279 ) ? total packets 1024 through maximum bytes in size ( section 13.3.2.9, on page 280 ) ? total oversized packets ( section 13.3.2.10, on page 281 ) ? total ok packets ( section 13.3.2.11, on page 282 ) ? total packets with crc errors ( section 13.3.2.12, on page 283 ) ? total multicast packets ( section 13.3.2.13, on page 284 ) ? total broadcast packets ( section 13.3.2.14, on page 285 ) ? total mac pause packets ( section 13.3.2.15, on page 286 ) ? total fragment packets ( section 13.3.2.16, on page 287 ) ? total jabber packets ( section 13.3.2.17, on page 288 ) ? total alignment errors ( section 13.3.2.18, on page 289 ) ? total bytes received from all packets ( section 13.3.2.19, on page 290 ) ? total bytes received from good packets ( section 13.3.2.20, on page 291 ) ? total packets with a symbol error ( section 13.3.2.21, on page 292 ) ? total mac control packets ( section 13.3.2.22, on page 293 ) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 67 revision 2.0 (02-14-13) datasheet 6.3.2 transmit mac the transmit mac generates an etherne t mac frame from tx fifo data. this includes generating the preamble and sfd, calculating and appending the frame checksum value, optionally padding undersize packets to meet the minimum packet requirement size (64 bytes), and maintaining a standard inter-frame gap time during transmit. the transmit mac can operate at 10/100mbps, half- or full-duplex, and with or without flow control depending on the state of the transmission. in half-duplex mode the transmit mac meets csma/cd ieee 802.3 requirements. the transmit mac will re-transmit if collisions occur during the first 64 bytes (normal collisions), or will discard the packet if collisions occur after the first 64 bytes (late collisions). the transmit mac follows the standard truncated bina ry exponential back-off algorithm, collision and jamming procedures. the transmit mac pre-pends the standard preamble and sfd to every packet from the fifo. the transmit mac also follows as default, the standard inter-frame gap (ifg). the default ifg is 96 bit times and can be adjusted via the ifg config field of the port x mac transmit configuration register (mac_tx_cfg_x) . packet padding and cyclic redundant code (fcs) ca lculation may be optionally performed by the transmit mac. the auto-padding pr ocess automatically adds enough zeros to packets shorter than 64 bytes. the auto-padding and fcs generation is controlled via the tx pad enable bit of the port x mac transmit configuration register (mac_tx_cfg_x) . the transmit fifo acts as a temporary buffer bet ween the transmit mac and the switch engine. the fifo logic manages the re-transmission for normal collision conditions or discards the frames for late or excessive collisions. when in full-duplex mode, the transmit mac uses t he flow-control algorithm specified in ieee 802.3. mac pause frames are used primarily for flow c ontrol packets, which pass signalling information between stations. mac pause frames have a uniq ue type of 8808h, and a pause op-code of 0001h. the mac pause frame contains the pause value in t he data field. the flow control manager will auto- adapt the procedure based on traffic volume and speed to avoid packet loss and unnecessary pause periods. when in half-duplex mode, the mac uses a back pre ssure algorithm. the back pressure algorithm is based on a forced collision and an aggressive back-off algorithm. 6.3.2.1 transmit counters the transmit mac gathers statistics on each packet and increments the related counter registers. the following transmit counters are supported for each switch fabric port. refer to table 13.12, indirectly accessible switch control and status registers, on page 257 and section 13.3.2.25 through section 13.3.2.42 for detailed descriptions of these counters. ? total packets deferred ( section 13.3.2.25, on page 296 ) ? total pause packets ( section 13.3.2.26, on page 297 ) ? total ok packets ( section 13.3.2.27, on page 298 ) ? total packets 64 bytes in size ( section 13.3.2.28, on page 299 ) ? total packets 65 through 127 bytes in size ( section 13.3.2.29, on page 300 ) ? total packets 128 through 255 bytes in size ( section 13.3.2.30, on page 301 ) ? total packets 256 through 511 bytes in size ( section 13.3.2.31, on page 302 ) ? total packets 512 through 1023 bytes in size ( section 13.3.2.32, on page 303 ) ? total packets 1024 through maximum bytes in size ( section 13.3.2.33, on page 304 ) ? total undersized packets ( section 13.3.2.34, on page 305 ) ? total bytes transmitted from all packets ( section 13.3.2.35, on page 306 ) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 68 smsc lan9313/lan9313i datasheet ? total broadcast packets ( section 13.3.2.36, on page 307 ) ? total multicast packets ( section 13.3.2.37, on page 308 ) ? total packets with a late collision ( section 13.3.2.38, on page 309 ) ? total packets with excessive collisions ( section 13.3.2.39, on page 310 ) ? total packets with a single collision ( section 13.3.2.40, on page 311 ) ? total packets with multiple collisions ( section 13.3.2.41, on page 312 ) ? total collision count ( section 13.3.2.42, on page 313 ) 6.4 switch engine (swe) the switch engine (swe) is a vlan layer 2 (link layer) switching engine supporting 3 ports. the swe supports the following types of frame formats: untagged frames, vlan tagged frames, and priority tagged frames. the swe supports both t he 802.3 and ethernet ii frame formats. the swe provides the control for all forwarding/filtering rules. it handles the address learning and aging, and the destination port resolution based upon the mac address and vlan of the packet. the swe implements the standard bridge port states for spanning tree and provides packet metering for input rate control. it also implements port mirroring, broadcast throttling, and multicast pruning and filtering. packet priorities are s upported based on the ipv4 tos bits and ipv6 traffic class bits using a diffserv table mapping, the non-diffserv map ped ipv4 precedence bits, vlan priority using a per port priority regeneration table, da based static priority, and traffic class mapping to one of 4 qos transmit priority queues. the following sections detail the vari ous features of the switch engine. 6.4.1 mac address lookup table the address logic resolution (alr) maintains a 1024 entry mac address table. the alr searches the table for the destination mac address. if the s earch finds a match, the associated data is returned indicating the destination port or ports, whether to filter the packet, the pa ckets priority (used if enabled), and whether to override the ingress and egress spanning tree port state. figure 6.3 displays the alr table entry structure. refer to the switch engine alr write data 0 register (swe_alr_wr_dat_0) and switch engine alr write data 1 register (swe_alr_wr_dat_1) for detailed descriptions of these bits. figure 6.3 alr table entry structure 55 age / override valid 56 static 54 filter 53 priority 52 51 port 50 49 48 mac address 47 0 ... bit downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 69 revision 2.0 (02-14-13) datasheet 6.4.1.1 learning/aging/migration the alr adds new mac addresses upon ingress along with the associated receive port. if the source mac address already exists, the entry is refreshed. this action serves two purposes. first, if the source port has changed due to a network reconfiguration (migration), it is updated. second, each instance the entry is refreshed, the ag ing status bit is set, keeping the entry active. learning can be disabled per port via the enable learning on ingress field of the switch engine port ingress configuration regist er (swe_port_ingrss_cfg) . during each aging period, the alr scans the le arned mac addresses. for entries which have the aging status bit set, the alr simply clears the bit. as mentioned above, if a mac address is subsequently refreshed, the aging bit will be set again and the process would repeat. if a learned entry already had its aging status bit cleared (by a previous scan), the alr will instead remove the learned entry. therefore, if two scans occur before a mac address is re freshed, the entry will be aged and removed. each aging period is approximately 5 mi nutes. therefore an entry will be aged and removed at a minimum of 5 minutes, and a maximum of 10 minutes. 6.4.1.2 static entries if a mac address entry is manually added by the host cpu, it can be (and typically is) marked as static. static entries are not subjected to the aging process. static entries also cannot be changed by the learning process (including migration). 6.4.1.3 multicast pruning the destination port that is returned as a result of a destination mac address lookup may be a single port or any combination of ports. the latter is used to setup multicast add ress groups. an entry with a multicast mac address would be entered manually by the host cpu with the appropriate destination port(s). typically, the static bit should also be set to prevent automatic aging of the entry. 6.4.1.4 address filtering filtering can be performed on a destination mac address. such an entry would be entered manually by the host cpu with the filter bit active. typically, the static bit should also be set to prevent automatic aging of the entry. 6.4.1.5 spanning tree port state override a special spanning tree port state override setting can be applied to mac address entries. when the host cpu manually adds an entry with both the static and age bits set, packets with a matching destination address will bypass the spanning tree por t state and will be forwarded. this feature is typically used to allow the reception of the bpdu pa ckets while a port is in the non-forwarding state. refer to section 6.4.5, "spanning tree support," on page 75 for additional details. 6.4.1.6 mac destination address lookup priority if enabled in the switch engine global ingress configuration register (swe_global_ingrss_cfg) , the transmit priority for static mac address entries is taken from the associated data of that entry. 6.4.1.7 host access the alr contains a learning engine that is used by the host cpu to add, delete, and modify the mac address table. this engine is accessed by using the switch engine alr command register (swe_alr_cmd) , switch engine alr command status register (swe_alr_cmd_sts) , switch engine alr write data 0 register (swe_alr_wr_dat_0) , and switch engine alr write data 1 register (swe_alr_wr_dat_1) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 70 smsc lan9313/lan9313i datasheet the following procedure should be followed in order to add, delete, and modify the alr entries: 1. write the switch engine alr write data 0 register (swe_alr_wr_dat_0) and switch engine alr write data 1 register (swe_alr_wr_dat_1) with the desired mac address and control bits. note: an entry can be deleted by setting the valid and static bits to 0. 2. write the switch engine alr command register (swe_alr_cmd) register with 0004h (make entry) 3. poll the make pending bit in the switch engine alr command status register (swe_alr_cmd_sts) until it is cleared. 4. write the switch engine alr command register (swe_alr_cmd) with 0000h. the alr contains a search engine that is used by the host to read the mac address table. this engine is accessed by using the switch engine alr command register (swe_alr_cmd) , switch engine alr read data 0 register (swe_alr_rd_dat_0) , and switch engine alr read data 1 register (swe_alr_rd_dat_1) . note: the entries read are not necessarily in the same order as they were learned or manually added. the following procedure should be followed in order to read the alr entries: 1. write the switch engine alr command register (swe_alr_cmd) with 0002h (get first entry). 2. write the switch engine alr command register (swe_alr_cmd) with 0000h (clear the get first entry bit) 3. poll the valid and end of table bits in the switch engine alr read data 1 register (swe_alr_rd_dat_1) until either are set. 4. if the valid bit is set, then the en try is valid and the data from the switch engine alr read data 0 register (swe_alr_rd_dat_0) and switch engine alr read data 1 register (swe_alr_rd_dat_1) can be stored. 5. if the end of table bit is set, then exit. 6. write the switch engine alr command register (swe_alr_cmd) with 0001h (get next entry). 7. write the switch engine alr command register (swe_alr_cmd) with 0000h (clear the get next entry bit) 8. go to step 3. note: refer to section 13.3.3.1, on page 316 through section 13.3.3.6, on page 323 for detailed definitions of these registers. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 71 revision 2.0 (02-14-13) datasheet 6.4.2 forwarding rules upon ingress, packets are filtered or forwarded based on the following rules: ? if the destination port equals the source por t (local traffic), the packet is filtered. ? if the source port is not in the forwardi ng state, the packet is filtered (unless the spanning tree port state override is in effect). ? if the destination port is not in the forwar ding state, the packet is filtered (unless the spanning tree port state override is in effect). ? if the filter bit for the destination address is set in the alr table, the packet is filtered. ? if the packet has a unicast destination mac addre ss which is not found in the alr table and the drop unknown bit is set, the packet is filtered. ? if the packet has a multicast destination mac addre ss which is not found in the alr table and the filter multicast bit is set, the packet is filtered. ? if the packet has a broadcast destination mac a ddress and the broadcast storm control level has been reached, the packet is discarded. ? if drop on yellow is set, the packet is color ed yellow, and randomly selected, it is discarded. ? if drop on red is set and the packet is colored red, it is discarded. ? if the destination address was not found in the alr table (an unknown or a broadcast) and the broadcast buffer level is exceeded, the packet is discarded. ? if there is insufficient buffer space, the packet is discarded. when the switch is enabled for vlan support, these following rules also apply: ? if the packet is untagged or priority tagged and the admit only vlan bit for the ingress port is set, the packet is filtered. ? if the packet is tagged and has a vi d equal to fffh, it is filtered. ? if enable membership checking on ingress is set, admit non member is cleared, and the source port is not a member of the inco ming vlan, the packet is filtered. ? if enable membership checking on ingress is se t and the destination port is not a member of the incoming vlan, the packet is filtered. ? if the destination address was not found in the alr table (as unknown or broadcast) and the vlan broadcast domain containment resulted in zero va lid destination ports, the packet is filtered. note: for the last three cases, if the vid is not in the vlan table, the vlan is considered foreign and the membership result is null. a null membership will result in the packet being filtered if enable membership checking is set. a null membership will also result in the packet being filtered if the destin ation address is not found in the alr table (since the packet would have no destinations). downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 72 smsc lan9313/lan9313i datasheet 6.4.3 transmit priori ty queue selection the transmit priority queue may be selected from five options. as shown in figure 6.4 , the priority may be based on: ? the static value for the destination address in the alr table ? the precedence bits in the ipv4 tos octet ? the diffserv mapping table indexed by the ipv4 tos octet or the ipv6 traffic class octet ? the vlan tag priority field using the per port priority regeneration table ? the port default the last four options listed are sent through the tr affic class table which maps the selected priority to one of the four output queues. t he static value from the alr tabl e directly specifies the queue. figure 6.4 switch engine transmit queue selection priority calculation programmable diffserv table programmable port default table programmable priority regeneration table per port 3b 3b 3b 2b 6b 3b 2b static da override programmable traffic class table packet is tagged vl higher priority packet is ipv 4 packet is ip use precedence use ip alr static bit ipv4(tos) ipv6(tc) da highest priority priority queue source port alr priority vlan priority ipv4 precedence 2b 3b vlan enable packet is from host downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 73 revision 2.0 (02-14-13) datasheet the transmit queue priority is based on the pa cket type and device configuration as shown in figure 6.5 . refer to section 13.3.3.16, "switch engine global ingress configuration register (swe_global_ingrss_cfg)," on page 333 for definitions of the configuration bits. figure 6.5 switch engine transmit queue calculation queue = alr priority da highest priority alr static bit y y resolved priority = priority regen[vlan priority] n packet is ipv 4/v6 & use ip resolved priority = ip precedence y use precedence y n resolved priority = diffserv[tc] n n y vlan enable & packet is tagged y n n resolved priority = default priority[source port] wait for alr result queue = traffic class[resolved priority] packet is ipv 4 resolved priority = diffserv[tos] y n get queue done vl higher priority vlan enable & packet is tagged n y get queue packet from host n y downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 74 smsc lan9313/lan9313i datasheet 6.4.3.1 port default priority as detailed in figure 6.5 , the default priority is based on the ingr ess ports priority bits in its port vid value. the pvid table is read and written by using the switch engine vlan command register (swe_vlan_cmd) , switch engine vlan write data register (swe_vlan_wr_data) , switch engine vlan read data register (swe_vlan_rd_data) , and switch engine vlan command status register (swe_vlan_cmd_sts) . refer to section 13.3.3.8, on page 325 through section 13.3.3.11, on page 328 for detailed vlan register descriptions. 6.4.3.2 ip precedence based priority the transmit priority queue can be chosen based on the precedence bits of the ipv4 tos octet. this is supported for tagged and non-tagged packets for both type field and length field encapsulations. the precedence bits are the three most signi ficant bits of t he ipv4 tos octet. 6.4.3.3 diffserv based priority the transmit priority queue can be chosen based on the diffserv usage of the ipv4 tos or ipv6 traffic class octet. this is supported for tagg ed and non-tagged packets for both type field and length field encapsulations. the diffserv table is used to determine the packet pr iority from the 6-bit differentiated services (ds) field. the ds field is defined as the six most signif icant bits of the ipv4 tos octet or the ipv6 traffic class octet and is used as an index into the diffserv table. the output of the diffserv table is then used as the priority. this pr iority is then passed through the traffic class table to select the transmit priority queue. note: the diffserv table is not initialized upon rese t or power-up. if diffserv is enabled, then the full table must be initialized by the host. the diffserv table is read and written by using the switch engine diffserv table command register (swe_diffserv_tbl_cfg) , switch engine diffserv table write data register (swe_diffserv_tbl_wr_data) , switch engine diffserv table read data register (swe_diffserv_tbl_rd_data) , and switch engine diffserv tabl e command status register (swe_diffserv_tbl_cmd_sts) . refer to section 13.3.3.12, on page 329 through section 13.3.3.15, on page 332 for detailed diffserv register descriptions. 6.4.3.4 vlan priority as detailed in figure 6.5 , the transmit priority queue can be ta ken from the priority field of the vlan tag. the vlan priority is sent through a per port priority regeneration table, which is used to map the vlan priority into a user defined priority. the priority regeneration tabl e is programmed by using the switch engine po rt 0 ingress vlan priority regeneration table regi ster (swe_ingrss_regen_tbl_mii) , switch engine port 1 ingress vlan priority regeneration table register (swe_ingrss_regen_tbl_1) , and switch engine port 2 ingress vlan priority regeneration table register (swe_ingrss_regen_tbl_2) . refer to section 13.3.3.33, on page 352 through section 13.3.3.35, on page 354 for detailed descriptions of these registers. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 75 revision 2.0 (02-14-13) datasheet 6.4.4 vlan support the switch engine supports 16 active vlans out of a possible 4096. the vlan table contains the 16 active vlan entries, each consisti ng of the vid, the port membersh ip, and un-tagging instructions. on ingress, if a packet has a vlan tag containing a valid vid (not 000h or fffh), the vid table is searched. if the vid is found, the vlan is considered active and the membership and un-tag instruction is used. if the vid is not found, the vlan is considered foreign and the membership result is null. a null membership will result in the pa cket being filtered if enable membership checking is set. a null membership will also result in the packet being filtered if the destination address is not found in the alr table (since the packet would have no destinations). on ingress, if a packet does not have a vlan tag or if the vlan tag contains vid with a value of 0 (priority tag), the packet is assigned a vlan based on the port default vid (pvid) and priority. the pvid is then used to access the above vlan table. the vlan membership of the packet is used for ingress and egress checking and for vlan broadcast domain containment. the un-tag instructions are us ed at egress on ports defined as hybrid ports. refer to section 13.3.3.8, on page 325 through section 13.3.3.11, on page 328 for detailed vlan register descriptions. 6.4.5 spanning tree support hardware support for the spanning tree protocol (stp) and the rapid spanning tree protocol (rstp) includes a per port state register as well as the override bit in the mac address table entries ( section 6.4.1.5, on page 69 ) and the host cpu port special tagging ( section 6.4.10, on page 80 ). the switch engine port state register (swe_port_state) is used to place a port into one of the modes as shown in ta b l e 6 . 2 . normally only port 1 and port 2 are placed into modes other than forwarding. port 0 should normally be left in forwarding mode. figure 6.6 vlan table entry structure table 6.2 spanning tree states port state hardware action software action 01 - blocking (also used for disabled) received packets on the port are discarded. transmissions to the port are blocked. learning on the port is disabled. the mac address table should be programmed with entries that the host cpu needs to receive (e.g. the bpdu address). the static and override bits should be set. the host cpu should not send any packets to the port in this state. the host cpu should discard received packets from this port when in the disabled state. note: there is no hardware distinction between the blocking and disabled states. 17 16 15 14 13 12 vid 11 0 ... un-tag mii member mii un-tag port 1 member port 1 un-tag port 2 member port 2 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 76 smsc lan9313/lan9313i datasheet 6.4.6 ingress flow metering and coloring the lan9313/lan9313i supports hardware ingress ra te limiting by metering packet streams and marking packets as either green, yellow, or red according to three traffic parameters: committed information rate (cir), committed burst size (cbs), and excess burst size (ebs). a packet is marked green if it does not exceed the cbs, yellow if it exceed s to cbs but not the ebs, or red otherwise. ingress flow metering and coloring is enabled via the ingress rate enable bit in the switch engine ingress rate configuration re gister (swe_ingrss_rate_cfg) . once enabled, each incoming packet is classified into a stream. streams are defined as per port (3 streams), per priority (8 streams), or per port & priority (24 streams) as selected via the rate mode bits in the switch engine ingress rate configuration regist er (swe_ingrss_rate_cfg) . each stream can have a different cir setting. all streams share co mmon cbs and ebs settin gs. cir, cbs, and ebs are programmed via the switch engine ingress rate command register (swe_ingrss_rate_cmd) and switch engine ingress rate write data register (swe_ingrss_rate_wr_data) . each stream is metered according to rfc 2697. at the rate set by the cir, two token buckets are credited per stream. first, the committed burst bucke t is incremented up to the maximum set by the cbs. once the committed burst bucket is full, th e excess burst bucket is incremented up to the maximum set by the ebs. the cir ra te is specified in time per byte. the value programmed is in approximately 20 ns per byte increments. typical values are listed in ta b l e 6 . 3 . when a port is receiving at 10mbps, any setting faster than 39 has the effect of not limiting the rate. 11 - listening received packets on the port are discarded. transmissions to the port are blocked. learning on the port is disabled. the mac address table should be programmed with entries that the host cpu needs to receive (e.g. the bpdu address). the static and override bits should be set. the host cpu may send packets to the port in this state. 10 - learning received packets on the port are discarded. transmissions to the port are blocked. learning on the port is enabled. the mac address table should be programmed with entries that the host cpu needs to receive (e.g. the bpdu address). the static and override bits should be set. the host cpu may send packets to the port in this state. 00 - forwarding received packets on the port are forwarded normally. transmissions to the port are sent normally. learning on the port is enabled. the mac address table should be programmed with entries that the host cpu needs to receive (e.g. the bpdu address). the static and override bits should be set. the host cpu may send packets to the port in this state. table 6.2 spanning tree states (continued) port state hardware action software action downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 77 revision 2.0 (02-14-13) datasheet after each packet is received, th e bucket is decremented. if the co mmitted burst bucket has sufficient tokens, it is debit ed and the packet is colored green. if the committed burst bucket lacks sufficient tokens for the packet, the excess burst bucket is checked. if the excess burst bucket has sufficient tokens, it is debited, the packet is colored yellow and is subjected to random discard. if the excess burst bucket lacks sufficient tokens for the pa cket, the packet is colored red and is discarded. note: all of the token buckets are initialized to t he default value of 1536. if lower values are programmed into the cbs and ebs parameters, the token buckets will need to be normally depleted below these values before the values have any affect on limiting the maximum value of the token buckets. refer to section 13.3.3.25, on page 343 through section 13.3.3.29, on page 348 for detailed register descriptions. 6.4.6.1 ingress flow calculation based on the flow monitoring mode, an ingress flow definition can include the ingress priority. this is calculated similarly to the transmit queue with th e exception that the priority regeneration and the traffic class table are not used. as shown in figure 6.7 , the priority can be based on: ? the precedence bits in the ipv4 tos octet ? the diffserv mapping table indexed by the ipv4 tos octet or the ipv6 traffic class octet ? the vlan tag priority field (but not through the per port priority regeneration table) ? the port default table 6.3 typical ingress rate settings cir setting time per byte bandwidth 0-3 80 ns 100 mbps 4 100 ns 80 mbps 5 120 ns 67 mbps 6 140 ns 57 mbps 7 160 ns 50 mbps 9 200 ns 40 mbps 12 260 ns 31 mbps 19 400 ns 20 mbps 39 800 ns 10 mbps 79 1600 ns 5 mbps 160 3220 ns 2.5 mbps 402 8060 ns 1 mbps 804 16100 ns 500 kbps 1610 32220 ns 250 kbps 4028 80580 ns 100 kbps 8056 161140 ns 50 kbps downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 78 smsc lan9313/lan9313i datasheet the ingress flow calculation is based on the packe t type and the device configuration as shown in figure 6.8 . figure 6.7 switch engine ingr ess flow priority selection figure 6.8 switch engine ingress flow priority calculation programmable diffserv table programmable port default table 3b 3b 2b 6b 3b packet is tagged vl higher priority packet is ipv 4 packet is ip use precedence use ip ipv4(tos) ipv6(tc) flow priority source port vlan priority ipv4 precedence 3b 3b vlan enable priority calculation packet is from host flow priority = vlan priority n packet is ipv 4/v6 & use ip flow priority = ip precedence y use precedence y n flow priority = diffserv[tc] n y vlan enable & packet is tagged y n n flow priority = default priority[source port] packet is ipv 4 flow priority = diffserv[tos] y n get flow priority done vl higher priority vlan enable & packet is tagged n y get flow priority packet from host y downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 79 revision 2.0 (02-14-13) datasheet 6.4.7 broadcast storm control in addition to ingress rate limiting, the lan9313/lan9313i supports hardware broadcast storm control on a per port basis. this feature is enabled via the switch engine broadcast throttling register (swe_bcst_throt) . the allowed rate per port is specified as the number of bytes multiplied by 64 allowed to be received every 1.72 ms interval. pa ckets that exceed this limit are dropped. typical values are listed in ta b l e 6 . 4 . when a port is receiving at 10mbps, any setting above 34 has the effect of not limiting the rate. in addition to the rate limit, the buffer manager broadcast buffer level register (bm_bcst_lvl) specifies the maximum number of buffers that can be used by bro adcasts, multicasts, and unknown unicasts. 6.4.8 ipv4 igmp support the lan9313/lan9313i provides internet group management protocol (igmp) hardware support using two mechanisms: igmp monitoring and multicast pruning. on ingress, if igmp packet monitoring is enabled in the switch engine global ingress configuration register (swe_global_ingrss_cfg) , igmp multicast packets are trapped and redirected to the igmp monitoring port (typically set to the port to which the host cpu is connected). igmp packets are identified as ipv4 packets with a protocol of 2. both ethernet and ieee 802.3 frame formats are supported as are vlan tagged packets. once the igmp packets are received by the host cp u, the host software can decide which port or ports need to be members of the multicast group. this group is then added to the alr table as detailed in section 6.4.1.3, "multicast pruning," on page 69 . the host software should also forward the original igmp packet if necessary. normally, packets are never transm itted back to the receiving port . for igmp monitoring, this may optionally be enabled via the switch engine global ingress configuration register (swe_global_ingrss_cfg) . this function would be used if the monitoring port wished to participate in the igmp group without the need to perform special handling in the transmit portion of the driver software. table 6.4 typical br oadcast rate settings broadcast throttle level bandwidth 252 75 mbps 168 50 mbps 134 40 mbps 67 20 mbps 34 10 mbps 17 5 mbps 82 . 4 m b p s 41 . 2 m b p s 3 900 kbps 2 600 kbps 1 300 kbps downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 80 smsc lan9313/lan9313i datasheet note: most forwarding rules are skipped when a packet is monitored. however, a packet is still filtered if: ? the source port is not in the forwarding state (unless spanning tree port state override is in effect. ? vlans are enabled, the packet is untagged or priority tagged, and the admit only vlan bit for the ingress port is set. ? vlans are enabled and the packet is tagged and had a vid equal to fffh. ? vlans are enabled, enabled membership checking on ingress is set, admit non member is cleared, and the source port is not a member of the incoming vlan. 6.4.9 port mirroring the lan9313/lan9313i supports port mirroring where packets received or transmitted on a port or ports can also be copied onto another sniffer port. port mirroring is configured using the switch engine port mirrori ng register (swe_port_mirror) . multiple mirrored ports can be defined, but only one sniffer port can be defined. when receive mirroring is enabled, packets that are forwarded from a port designated as a mirrored port are also transmitted by the sniffer port. for ex ample, port 2 is setup to be a mirrored port and port 0 is setup to be the sniffer port. if a packet is received on port 2 with a destination of port 1, it is forwarded to both port 1 and port 0. when transmit mirroring is enabled, packets that ar e forwarded to a port designated as a mirrored port are also transmitted by the sniffer port. for example, port 2 is setup to be a mirrored port and port 0 is setup to be the sniffer port. if a packet is received on port 1 with a destination of port 2, it is forwarded to both port 2 and port 0. note: a packet will never be transmitted out of the receiving port. a receive packet is not normally mirrored if it is filtered. th is can optionally be enabled. 6.4.10 host cpu port special tagging the switch engine ingress port type register (swe_ingrss_port_typ) and buffer manager egress port type regist er (bm_egrss_port_type) are used to enable a special vlan tag that is used by the host cpu. this special tag is used to specify the port(s) where packets from the cpu should be sent, and to indicate which port received the packet that was forwarded to the cpu. 6.4.10.1 packets from the host cpu the switch engine ingress port type register (swe_ingrss_port_typ) configures the switch to use the special vlan tag in packets from the host cpu as a destination port indicator. a setting of 11b should be used on the port that is connected to the host cpu (typically port 0). a setting of 00b should be used on the normal network ports. the special vlan tag is a normal vlan tag where the vid field is used as the destination port indicator. if vid bit 3 is zero, then bits 0 and 1 s pecify the destination port (0, 1, 2) or broadcast (3). if vid bit 3 is one, then the normal alr lookup is performed and learning is performed on the source address. the pri field from the vlan tag is used as the packet priority. upon egress from the destination port(s), the specia l tag is removed. if a regular vlan tag needs to be sent as part of the packet, then it should be part of the packet data from the host cpu port or set as an unused bit in the vid field. note: when specifying port 0 as the destination port, t he vid will be set to 0. a vid of 0 is normally considered a priority tagged packet. such a packet will be filtered if admit only vlan is set on the host cpu port. either avoid setting admit only vlan on the host cpu port or set an unused bit in the vid field. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 81 revision 2.0 (02-14-13) datasheet note: the maximum size tagged packet that can normally be sent into a switch port (from the mii port) is 1522 bytes. since the special tag consumes four bytes of the packet length, the outgoing packet is limited to 1518 bytes, even if it contains a regular vlan tag as part of the packet data. if a larger outgoing packet is required, the jumbo2k bit in the port x mac receive configuration register (mac_rx_cfg_x) of port 0 should be set. 6.4.10.2 packets to the host cpu the buffer manager egress port type register (bm_egrss_port_type) configures the switch to add the special vlan tag in packets to the host cpu as a source port indicator. a setting of 11b should be used only on the port that is connected to the host cpu (typically port 0). other settings can be used on the normal network ports as needed. the special vlan tag is a normal vlan tag where bits 0 and 1 of the vid field specify the source port (0, 1, or 2). upon egress from the host cpu port, the special t ag is added. if a regular vlan tag already exists, it is not deleted. instead it will follow the special tag. 6.4.11 counters a counter is maintained per port that contains th e number of mac address that were not learned or were overwritten by a different address due to ma c address table space limi tations. these counters are accessible via the following registers: ? switch engine port 0 learn discard c ount register (swe_lrn_discrd_cnt_mii) ? switch engine port 1 learn discard count register (swe_lrn_discrd_cnt_1) ? switch engine port 2 learn discard count register (swe_lrn_discrd_cnt_2) a counter is maintained per port that contains th e number of packets filtered at ingress. this count includes packets filtered due to broadcast th rottling, but does not include packets dropped due to ingress rate limiting. these counters are accessible via the following registers: ? switch engine port 0 ingress filtered count register (swe_filtered_cnt_mii) ? switch engine port 1 ingress filtered count register (swe_filtered_cnt_1) ? switch engine port 2 ingress filtered count register (swe_filtered_cnt_2) 6.5 buffer manager (bm) the buffer manager (bm) provides control of the fr ee buffer space, the multiple priority transmit queues, transmission scheduling, and packet dropping. vlan tag insertion and removal is also performed by the buffer manager. the following sections detail the various features of the buffer manager. 6.5.1 packet buffe r allocation the packet buffer consists of 32kb of ram that is dynamically allocated in 1 28 byte blocks as packets are received. up to 16 blocks may be used per packe t, depending on the packet length. the blocks are linked together as the packet is received. if a packet is filtered, dropped, or contains a receive error, the buffers are reclaimed. 6.5.1.1 buffer limits a nd flow control levels the bm keeps track of the amount of buffers used per each ingress port. these counts are used to generate flow control (half-duplex backpressure or full-duplex pause frames) and to limit the amount of buffer space that can be used by any individual receiver (hard drop limit). the flow control and drop downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 82 smsc lan9313/lan9313i datasheet limit thresholds are dynamic and adapt based on the current buffer usage. based on the number of active receiving ports, the drop level and flow c ontrol pause and resume thresholds adjust between fixed settings and two user programmable levels via the buffer manager drop level register (bm_drop_lvl) , buffer manager flow control pause level register (bm_fc_pause_lvl) , and buffer manager flow control resume level register (bm_fc_resume_lvl) respectively. the bm also keeps a count of the number of buf fers that are queued for multiple ports (broadcast queue). this count is compared against the buffer manager broadcast buffer level register (bm_bcst_lvl) , and if the configured drop level is re ached or exceeded, subsequent packets are dropped. 6.5.2 random earl y discard (red) based on the ingress flow monitoring detailed in section 6.4.6, "ingress flow metering and coloring," on page 76 , packets are colored as green, yellow, or red. packets colored red are always discarded if the drop on red bit in the buffer manager configuration register (bm_cfg) is set. if the drop on yellow bit in the buffer manager configuration register (bm_cfg) is set, packets colored yellow are randomly discarded based on the moving average number of buffers used by the ingress port. the probability of a discard is programmable into the random discard weight table via the buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd) , buffer manager random discard table write da ta register (bm_rndm_dscrd_tbl_wdata) , and buffer manager random discard table read data register (bm_rndm_dscrd_tbl_rdata) . the random discard weight table contains sixteen entr ies, each 10-bits wide. each entry corresponds to a range of the average number of buffers used by t he ingress port. entry 0 is for 0 to 15 buffers, entry 1 is for 16 to 31 buffers, etc. the probability for ea ch entry us set in 1/1024s. for example, a setting of 1 is 1-in-1024, or approximately 0.1%. a setting of all ones (1023) is 1023-in-1024, or approximately 99.9%. refer to section 13.3.4.10, "buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd)," on page 370 for additional details on writing and reading the random discard weight table. 6.5.3 transmit queues once a packet has been completely received, it is queued for transmit. there are four queues per transmit port, one for each level of tr ansmit priority. each queue is virtual (if there are no packets for that port/priority, the queue is empty), and dynam ic (a queue may be any length if there is enough memory space). when a packet is read from the memory and sent out to the corresponding port, the used buffers are released. 6.5.4 transmit priori ty queue servicing when a transmit queue is non-empty, it is serviced and the packet is read from the buffer ram and sent to the transmit mac. if ther e are multiple queues that require servicing, one of two methods may be used: fixed priority ordering, or weighted round-r obin ordering. if the fixed priority queue servicing bit in the buffer manager configurat ion register (bm_cfg) is set, a strict order, fixed priority is selected. transmit queue 3 has the highest priority, foll owed by 2, 1, and 0. if the fixed priority queue servicing bit in the buffer manager configuration register (bm_cfg) is cleared, a weighted round- robin order is followed. assuming all four queues are non-empty, the service is weighted with a 9:4:2:1 ratio (queue 3,2,1,0). the servicing is blended to avoid burstiness (e.g. queue 3, then queue 2, then queue 3, etc.). 6.5.5 egress rate limiting (leaky bucket) for egress rate limiting, the leaky bucket algorithm is used on each output priority queue. for each output port, the bandwidth that is used by each priority queue can be limited. if any egress queue receives packets faster than the specified egress rate, packets will be accumulated in the packet memory. after the memory is used, packet dropping or flow control will be triggered. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 83 revision 2.0 (02-14-13) datasheet note: egress rate limiting occurs before the transmit priority queue servicing , such that a lower priority queue will be serviced if a highe r priority queue is being rate limited. the egress limiting is enabled per priority queue. after a packet is selected to be sent, its length is recorded. the switch then waits a programmable am ount of time, scaled by the packet length, before servicing that queue once again. the amount of ti me per byte is programmed into the buffer manager egress rate registers (refer to section 13.3.4.14 through section 13.3.4.19 for detailed register definitions). the value programmed is in approximately 20 ns per byte increments. typical values are listed in ta b l e 6 . 5 . when a port is transmitting at 10 mbps, any setting above 39 has the effect of not limiting the rate. note 6.3 these are the unlimited max bandwidths when ifg and preamble are taken into account. 6.5.6 adding, removing, and changing vlan tags based on the port configuration and the received pa cket formation, a vlan tag can be added to, removed from, or modified in a packet. there are four received packet type cases: non-tagged, priority- tagged, normal-tagged, and cpu special-tagged. ther e are also four possible settings for an egress port: dumb, access, hybrid, and cpu. in addition, each vlan table entry can specify the removal of the vlan tag (the entrys un-tag bit). the tagging/un-tagging rules are specified as follows: ? dumb port - this port type generally does not change the tag. when a received packet is non-tagged, priority-tagged, or normal-tagged, the packet passes untouched. when a packet is received special-tagged from a cpu port, the special tag is removed. ? access port - this port type generally does not support tagging. when a received packet in non-tagged, the packet passes untouched. when a received packet is priority-tagged or normal-tagged, the tag is removed. table 6.5 typical egress rate settings egress rate setting time per byte bandwidth @ 64 byte packet bandwidth @ 512 byte packet bandwidth @ 1518 byte packet 0-3 80 ns 76 mbps ( note 6.3 ) 96 mbps ( note 6.3 )9 9 m b p s ( note 6.3 ) 4 100 ns 66 mbps 78 mbps 80 mbps 5 120 ns 55 mbps 65 mbps 67 mbps 6 140 ns 48 mbps 56 mbps 57 mbps 7 160 ns 42 mbps 49 mbps 50 mbps 9 200 ns 34 mbps 39 mbps 40 mbps 12 260 ns 26 mbps 30 mbps 31 mbps 19 400 ns 17 mbps 20 mbps 20 mbps 39 800 ns 8.6 mbps 10 mbps 10 mbps 78 1580 ns 4.4 mbps 5 mbps 5 mbps 158 3180 ns 2.2 mbps 2.5 mbps 2.5 mbps 396 7940 ns 870 kbps 990 kbps 1 mbps 794 15900 ns 440 kbps 490 kbps 500 kbps 1589 31800 ns 220 kbps 250 kbps 250 kbps 3973 79480 ns 87 kbps 98 kbps 100 kbps 7947 158960 ns 44 kbps 49 kbps 50 kbps downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 84 smsc lan9313/lan9313i datasheet when a received packet is special-tagged from a cpu port, the special tag is removed. ? cpu port - packets transmitted from this port type generally contain a special tag. special tags are described in detail in section 6.4.10, "host cpu port special tagging," on page 80 . ? hybrid port - generally, this port type supports a mix of normal-tagged and non-tagged packets. it is the most complex, but most flexible port type. for clarity, the following details the incoming un-tag instruction. as described in section 6.4.4, "vlan support," on page 75 , the un-tag instruction is one of three un-tag bits from the applicable entry in the vlan table, selected by the ingress port number. th e entry in the vlan table is either the vlan from the received packet or the ingress ports default vid. ? when a received packet is non-tagged, a new vlan tag is added if two conditions are met. first, the insert tag bit for the egress port in the buffer manager egress port type register (bm_egrss_port_type) must be set. second, the un-tag instruction associated with the ingress ports default vid must be cleared. the vlan tag that is added will have a vid and priority taken from the ingress ports default vid and priority. ? when a received packet is priority-tagged, either the tag is removed or it is modified. if the un-tag instruction associated with the ingress ports default vid is set, then the tag is removed. otherwise, the tag is modified. the vid of the new vlan tag is changed to the ingress ports default vid. if the change priority bit in the buffer manager egress port type register (bm_egrss_port_type) for the egress port is set, then the priority field of the new vlan tag is also changed to the ingress ports default priority. ? when a received packet is normal-tagged, either the tag is removed, modified, or passed. if the un-tag instruction associated with the vid in the received packet is set, then the tag is removed. else, if the change tag bit in the buffer manager egress port type register (bm_egrss_port_type) for the egress port is clear, the packet is untouched. else, if both the change vlan id and the change priority bits in the buffer manager egress port type register (bm_egrss_port_type) for the egress port are clear, the packet passes untouched. otherwise, the tag is modified. if the change vlan id bit for the egress port is set, the vod of the new vlan tag is changed to the egress ports default id. if the change priority bit for the egress port is set, the priority field of the new vlan is changed to the egress ports default priority. ? when a packet is received special-tagged from a cpu port, the special tag is removed. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 85 revision 2.0 (02-14-13) datasheet hybrid tagging is summarized in figure 6.9 . the default vlan id and priority of each port may be configured via the following registers: ? buffer manager port 0 default vlan id and priority register (bm_vlan_mii) ? buffer manager port 1 default vlan id and priority register (bm_vlan_1) ? buffer manager port 2 default vlan id and priority register (bm_vlan_2) figure 6.9 hybrid port tagging and un-tagging insert tag [egress_port] default vid [ingress_port] un-tag bit y non-tagged y add tag vid = default vid [ingress_port] priority = default priority [ingress_port] y send packet untouched n priority tagged default vid [ingress_port] un-tag bit y strip tag n normal tagged received vid un-tag bit y strip tag change tag [egress_port] n n send packet untouched y change priority [egress_port] modify tag vid = default vid [ingress_port] priority = default priority [ingress_port] n change vlan id [egress_port] change priority [egress_port] change priority [egress_port] y n n modify tag vid = default vid [egress_port] priority = default priority [egress_port] y modify tag vid = default vid [egress_port] priority = unchanged n y modify tag vid = unchanged priority = default priority [egress_port] special tagged strip tag modify tag vid = default vid [ingress_port] priority = unchanged n receive tag type downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 86 smsc lan9313/lan9313i datasheet 6.5.7 counters a counter is maintained per port that contains the number of packets dropped due to buffer space limits and ingress rate limit discarding (red and random yellow dropping). these counters are accessible via the following registers: ? buffer manager port 0 drop count register (bm_drp_cnt_src_mii) ? buffer manager port 1 drop count register (bm_drp_cnt_src_1) ? buffer manager port 2 drop count register (bm_drp_cnt_src_2) a counter is maintained per port that contains the number of packets dropped due solely to ingress rate limit discarding (red and random yellow droppi ng). this count value can be subtracted from the drop counter, as described above, to obtain the drop counts due solely to buffer space limits. t he ingress rate drop counters are accessible via the following registers: ? buffer manager port 0 ingress rate drop count register (bm_rate_drp_cnt_src_mii) ? buffer manager port 1 ingress rate drop count register (bm_rate_drp_cnt_src_1) ? buffer manager port 2 ingress rate drop count register (bm_rate_drp_cnt_src_2) 6.6 switch fabric interrupts the switch fabric is capable of generating multiple maskable interrupts from the buffer manager, switch engine, and macs. these interrupts are detailed in section 5.2.2, "switch fabric interrupts," on page 57 . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 87 revision 2.0 (02-14-13) datasheet chapter 7 ethernet phys 7.1 functional overview the lan9313/lan9313i contains three phys: port 1 phy, port 2 phy and a virtual phy. the port 1 & 2 phys are identical in functionality and each connect their corresponding ethernet signal pins to the switch fabric mac of their re spective port. these phys interface with their respective mac via an internal mii interface. the virtual phy provides the virtual functionality of a phy and allows connection of an external mac to port 0 of the switch fabric as if it was con nected to a single port phy. all phys comply with the ieee 802.3 physical layer for twist ed pair ethernet and can be configured for full/half duplex 100 mbps (100base-tx) or 10mbps (10base-t) ethernet operation. all phy registers follow the ieee 802.3 (clause 22.2.4) spec ified mii management register set and can be configured indirectly via the external mii interface signals, or direct ly via the memory mapped virtual phy registers. in addition, the port 1 phy and port 2 phy can be co nfigured via the phy ma nagement interface (pmi). refer to section 13.2, "ethernet phy control and status registers" for details on the ethernet phy registers. the lan9313/lan9313i ethernet phys are discu ssed in detail in the following sections: ? section 7.2, "port 1 & 2 phys," on page 88 ? section 7.3, "virtual phy," on page 101 7.1.1 phy addressing each individual phy is assigned a unique default phy address via the phy_addr_sel_strap configuration strap as shown in ta b l e 7 . 1 . in addition, the port 1 phy and port 2 phy addresses can be changed via the phy address (phyadd) field in the port x phy special modes register (phy_special_modes_x) . for proper operation, all lan9313/lan9313i phy addresses must be unique. no check is performed to assure each phy is set to a different address. configuration strap values are latched upon the de-assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . table 7.1 default phy serial mii addressing phy_addr_sel_strap virtual phy default address value port 1 phy default address value port 2 phy default address value 0012 1123 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 88 smsc lan9313/lan9313i datasheet 7.2 port 1 & 2 phys functionally, each phy can be divided into the following sections: ? 100base-tx transmit and 100base-tx receive ? 10base-t transmit and 10base-t receive ? phy auto-negotiation ? hp auto-mdix ? mii mac interface ? phy management control note 7.1 because the port 1 phy and port 2 phy are func tionally identical, this section will describe them as the port x phy, or simply phy . wherever a lowercase x has been appended to a port or signal name, it can be replaced with 1 or 2 to indicate the port 1 or port 2 phy respectively. all references to phy in this section can be used interchangeably for both the port 1 & 2 phys. this nomenclature excludes the virtual phy. a block diagram of the port x phys main components can be seen in figure 7.1 . figure 7.1 port x phy block diagram hp auto-mdix txpx/txnx rxpx/rxnx to external port x ethernet pins 10/100 transmitter 10/100 reciever mii mac interface mii mdio auto- negotiation to port x switch fabric mac to mii mux leds pll phy management control registers from system clocks controller to gpio/led controller interrupts to system interrupt controller downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 89 revision 2.0 (02-14-13) datasheet 7.2.1 100base-tx transmit the 100base-tx transmit data path is shown in figure 7.2 . shaded blocks are those which are internal to the phy. each major block is explained in the following sections. 7.2.1.1 mii mac interface for a transmission, the switch fabric mac drives the transmit data to the phys mii mac interface. the mii mac interface is described in detail in section 7.2.7, "mii mac interface" . note: the phy is connected to the switch fabric ma c via standard mii signals. refer to the ieee 802.3 specification for additional details. 7.2.1.2 4b/5b encoder the transmit data passes from the mii block to t he 4b/5b encoder. this block encodes the data from 4-bit nibbles to 5-bit symbols (known as code-groups) according to ta b l e 7 . 2 . each 4-bit data-nibble is mapped to 16 of the 32 possible code-groups. the remaining 16 code-groups are either used for control information or are not valid. the first 16 code-groups are referred to by the hexadecimal values of their corresponding data nibbles, 0 through f. the remaining code-groups are given le tter designations with slashes on either side. for example, an idle code-group is /i/, a tr ansmit error code-group is /h/, etc. figure 7.2 100base-tx transmit data path port x mac 100m tx driver mlt-3 converter nrzi converter 4b/5b encoder magnetics cat-5 rj45 100m pll internal mii 25 mhz by 4 bits internal mii transmit clock 25mhz by 5 bits nrzi mlt-3 mlt-3 mlt-3 mlt-3 scrambler and piso 125 mbps serial mii mac interface 25mhz by 4 bits downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 90 smsc lan9313/lan9313i datasheet table 7.2 4b/5b code table code group sym receiver interpretation transmitter interpretation 11110 0 0 0000 data 0 0000 data 01001 1 1 0001 1 0001 10100 2 2 0010 2 0010 10101 3 3 0011 3 0011 01010 4 4 0100 4 0100 01011 5 5 0101 5 0101 01110 6 6 0110 6 0110 01111 7 7 0111 7 0111 10010 8 8 1000 8 1000 10011 9 9 1001 9 1001 10110 a a 1010 a 1010 10111 b b 1011 b 1011 11010 c c 1100 c 1100 11011 d d 1101 d 1101 11100 e e 1110 e 1110 11101 f f 1111 f 1111 11111 /i/ idle sent after /t/r/ until the mii transmitter enable signal (txen) is received 11000 /j/ first nibble of ssd, translated to 0101 following idle, else mii receive error (rxer) sent for rising mii transmitter enable signal (txen) 10001 /k/ second nibble of ssd, translated to 0101 following j, else mii receive error (rxer) sent for rising mii transmitter enable signal (txen) 01101 /t/ first nibble of esd, causes de-assertion of crs if followed by /r/, else assertion of mii receive error (rxer) sent for falling mii transmitter enable signal (txen) 00111 /r/ second nibble of esd, causes de- assertion of crs if following /t/, else assertion of mii receive error (rxer) sent for falling mii transmitter enable signal (txen) 00100 /h/ transmit error symbol sent fo r rising mii transmit error (txer) 00110 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 11001 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 00000 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 91 revision 2.0 (02-14-13) datasheet 7.2.1.3 scrambler and piso repeated data patterns (especially the idle code-group) can have power spectral densities with large narrow-band peaks. scrambling the data helps eliminate these peaks and spread the signal power more uniformly over the entire channel bandwidth. this uniform spectral density is required by fcc regulations to prevent excessive emi from being radiated by the physical wiring. the scrambler also performs the parallel in serial out conversion (piso) of the data. the seed for the scrambler is generated from the phy address, ensuring that each phy will have its own scrambler sequence. for more information on phy addressing, refer to section 7.1.1, "phy addressing" . 7.2.1.4 nrzi and mlt-3 encoding the scrambler block passes the 5-bit wide parallel data to the nrzi converter where it becomes a serial 125mhz nrzi data stream. the nrzi is then encoded to mlt-3. mlt-3 is a tri-level code where a change in the logic level represents a code bit 1 and the logic output remaining at the same level represents a code bit 0. 7.2.1.5 100m transmit driver the mlt-3 data is then passed to the analog transmitter, which drives the differential mlt-3 signal on output pins txpx and txnx (where x is replaced with 1 for the port 1 ph y, or 2 for the port 2 phy), to the twisted pair media across a 1:1 rati o isolation transformer. the 10base-t and 100base- tx signals pass through the same transformer so that common magnetics can be used for both. the transmitter drives into the 100 impedance of the cat-5 cable. cable termination and impedance matching require external components. 7.2.1.6 100m phase lock loop (pll) the 100m pll locks onto the reference clock and generates the 125mhz clock used to drive the 125 mhz logic and the 100base-tx transmitter. 00001 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 00010 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 00011 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 00101 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 01000 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 01100 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid 10000 /v/ invalid, mii receive error (rxer) if during mii receive data valid (rxdv) invalid table 7.2 4b/5b code table (continued) code group sym receiver interpretation transmitter interpretation downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 92 smsc lan9313/lan9313i datasheet 7.2.2 100base-tx receive the 100base-tx receive data path is shown in figure 7.3 . shaded blocks are those which are internal to the phy. each major block is explained in the following sections. 7.2.2.1 a/d converter the mlt-3 data from the cable is fed into the phy on inputs rxpx and rxnx (whe re x is replaced with 1 for the port 1 phy, or 2 for the port 2 phy) via a 1:1 ratio transformer. the adc samples the incoming differential signal at a rate of 125m samples per second. using a 64-level quantizer, 6 digital bits are generated to represent each sample. the dsp adjusts the gain of the a/d converter (adc) according to the observed signal levels such that the full dynamic range of the adc can be used. 7.2.2.2 dsp: equalizer, blw corre ction and clock/data recovery the 6 bits from the adc are fed into the dsp block. the equalizer in the dsp section compensates for phase and amplitude distortion caused by the physical channel (magnetics, connectors, and cat- 5 cable). the equalizer can restore the signal for any good-quality cat-5 cable between 1m and 150m. if the dc content of the signal is such that the low-frequency components fall below the low frequency pole of the isolation transformer, then the dro op characteristics of the transformer will become significant and baseline wander (blw) on the received signal will result. to prevent corruption of the received data, the phy corrects for blw and can receive the ansi x3.263-1995 fddi tp-pmd defined killer packet with no bit errors. the 100m pll generates multiple phases of the 125m hz clock. a multiplexer, controlled by the timing unit of the dsp, selects the optimum phase for sampling the data. this is used as the received recovered clock. this clock is used to extract the serial data from the received signal. figure 7.3 100base-tx receive data path port x mac a/d converter mlt-3 converter nrzi converter 4b/5b decoder magnetics cat-5 rj45 100m pll internal mii 25mhz by 4 bits internal mii receive clock 25mhz by 5 bits nrzi mlt-3 mlt-3 mlt-3 6 bit data descrambler and sipo 125 mbps serial dsp: timing recovery, equalizer and blw correction mlt-3 mii mac interface 25mhz by 4 bits downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 93 revision 2.0 (02-14-13) datasheet 7.2.2.3 nrzi and mlt-3 decoding the dsp generates the mlt-3 recovered levels that are fed to the mlt-3 converter. the mlt-3 is then converted to an nrzi data stream. 7.2.2.4 descrambler and sipo the descrambler performs an inverse function to the scrambler in the transmitter and also performs the serial in parallel out (sipo) conversion of the data. during reception of idle (/i/) symbols. the descr ambler synchronizes its descrambler key to the incoming stream. once synchronizati on is achieved, the descrambler locks on this key and is able to descramble incoming data. special logic in the descrambler ensures synchronization with the remote phy by searching for idle symbols within a window of 4000 bytes (40us). th is window ensures that a maximum packet size of 1514 bytes, allowed by the ieee 802.3 standard, ca n be received with no in terference. if no idle- symbols are detected within this time-period, rece ive operation is aborted and the descrambler re-starts the synchronization process. the de-scrambled signal is then aligned into 5-bit code-groups by recognizing the /j/k/ start-of-stream delimiter (ssd) pair at the start of a packet. once the code-word alignment is determined, it is stored and utilized until the next start of frame. 7.2.2.5 5b/4b decoding the 5-bit code-groups are translated into 4-bit data nibbles according to the 4b/5b table shown in ta b l e 7 . 2 . the translated data is presented on the internal mii rxd[3:0] signal lines to the switch fabric mac. the ssd, /j/k/, is translated to 0101 010 1 as the first 2 nibbles of the mac preamble. reception of the ssd causes the phy to assert the rxdv signal, indicating that valid data is available on the rxd bus. successive valid c ode-groups are translated to data nibbles. reception of either the end of stream delimiter (esd) consisting of the /t /r/ symbols, or at least two /i/ symbols causes the phy to de-assert carrier sense and rxdv. these symbols are not translated into data. 7.2.2.6 receiver errors during a frame, unexpected code-groups are consid ered receive errors. expected code groups are the data set (0 through f), and the /t/r/ (esd) symbo l pair. when a receive error occurs, the internal miis rxer signal is asserted and arbitrary data is driven onto the internal receive data bus (rxd) to the switch fabric mac. should an error be detected during the time that the /j/k/ delimiter is being decoded (bad ssd error), rxer is asserted and the value 1110b is driven onto the internal receive data bus (rxd) to the switch fabric mac. note that the internal miis data valid signal (rxdv) is not yet asserted when the bad ssd occurs. 7.2.2.7 mii mac interface for reception, the 4-bit data nibbles are sent to the mii mac interface block where they are sent via mii to the switch fabric mac. the mii mac interface is described in detail in section 7.2.7, "mii mac interface" . note: the phy is connected to the switch fabric mac via standard mii signals. refer to the ieee 802.3 specification for additional details. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 94 smsc lan9313/lan9313i datasheet 7.2.3 10base-t transmit data to be transmitted comes fr om the switch fabric mac. the 10base-t transmitter receives 4-bit nibbles from the internal mii at a rate of 2.5mhz and converts them to a 10mbps serial data stream. the data stream is then manchester-encoded and sent to the analog transmitter, which drives a signal onto the twisted pair via the external magnetics. 10base-t transmissions us e the following blocks: ? mii mac interface (digital) ? 10m tx driver (digital/analog) ? 10m pll (analog) 7.2.3.1 mii mac interface for a transmission, the switch fabr ic mac drives the transmit data to the phys mii mac interface. the mii mac interface is described in detail in section 7.2.7, "mii mac interface" . note: the phy is connected to the switch fabric mac via standard mii signals. refer to the ieee 802.3 specification for additional details. 7.2.3.2 10m tx driver and pll the 4-bit wide data is sent to the 10m tx driver block. the nibbles are converted to a 10mbps serial nrzi data stream. the 10m pll locks onto the extern al clock or internal oscillator and produces a 20mhz clock. this is used to manchester enc ode the nrz data stream. when no data is being transmitted (txen is low), the 10m tx driver blo ck outputs normal link pulses (nlps) to maintain communications with the remote link partner. the manchester encoded data is sent to the analog transmitter where it is shaped and filtered before be ing driven out as a differential signal across the txpx and txnx outputs (where x is replaced with 1 for the port 1 phy, or 2 for the port 2 phy). 7.2.4 10base-t receive the 10base-t receiver gets the m anchester-encoded analog signal from the cable via the magnetics. it recovers the receive clock from the signal and uses this clock to recover the nrzi data stream. this 10m serial data is converted to 4-bit data nibbles which are passed to the controller across the internal mii at a rate of 2.5mhz. 10base-t reception uses the following blocks: ? filter and squelch (analog) ? 10m rx (digital/analog) ? mii mac interface (digital) ? 10m pll (analog) 7.2.4.1 filter and squelch the manchester signal from the cable is fed into the phy on inputs rxpx and rxnx (where x is replaced with 1 for port 1, or 2 for port 2) via 1:1 ratio magnetics. it is first filtered to reduce any out-of-band noise. it then passes through a squelch circuit. the squelch is a set of amplitude and timing comparators that normally reject differential voltage levels below 300mv and detect and recognize differential voltages above 585mv. 7.2.4.2 10m rx and pll the output of the squelch goes to the 10m rx block where it is validated as manchester encoded data. the polarity of the signal is also checked. if the polarity is reversed (local rxp is connected to rxn of the remote partner and vice versa), then this is identified and corrected. the reversed condition downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 95 revision 2.0 (02-14-13) datasheet is indicated by the flag xpol, bit 4 in port x phy special control/status indication register (phy_special_control_stat_ind_x) . the 10m pll locks onto the received manchester signal and generates the received 20mhz clock from it. using this clock, the manchester encoded data is extracted and converted to a 10mhz nrzi data stream. it is then converted from serial to 4-bit wide parallel data. the rx10m block also detects valid 10base-t idle signals - normal li nk pulses (nlps) - to maintain the link. 7.2.4.3 mii mac interface for reception, the 4-bit data nibbles are sent to the mii mac interface block where they are sent via mii to the switch fabric mac. the mii mac interface is described in detail in section 7.2.7, "mii mac interface" . note: the phy is connected to the switch fabric mac via standard mii signals. refer to the ieee 802.3 specification for additional details. 7.2.4.4 jabber detection jabber is a condition in which a station transmits for a period of time longer than the maximum permissible packet length, usually due to a fault condition, that results in holding the txen input for an extended period of time. special logic is used to detect the jabber state and abort the transmission to the line, within 45ms. once txen is deasserted, the logic resets the jabber condition. 7.2.5 phy auto-negotiation the purpose of the auto-negotiation function is to automatically configure the phy to the optimum link parameters based on the capabilities of its link partner. auto-negotiation is a mechanism fo r exchanging configuration information between two link-partners and automatically selecting the highest performance mode of operation supported by both sides. auto-negotiation is fully defined in clause 28 of the ieee 802.3 specification and is enabled by se tting bit 12 (phy_an) of the port x phy basic control register (phy_basic_control_x) . the advertised capabilities of the phy are stored in the port x phy auto-negot iation advertisement register (phy_an_adv_x) . the phy contains the ability to advertise 100base-tx and 10base-t in both full or half-duplex modes. besides the connection speed, the phy can advertise remote fault indication and symmetric or asymmetric pause flow control as defined in th e ieee 802.3 specification. the lan9313/lan9313i does not support next page capability. many of the default advertised capabilities of the phy are determined via configuration straps as shown in section 13.2.2.5, "port x phy auto-negotiation advertisement re gister (phy_an_adv_x)," on page 243 . refer to section 4.2.4, "configuration straps," on page 47 for additional details on how to use the lan9313/lan9313i configuration straps. once auto-negotiation has completed, information about the resolved link and the results of the negotiation process are reflected in the speed indication bits in the port x phy special control/status register (phy_special_control_status_x) , as well as the port x phy auto-negotiation link partner base page ability regi ster (phy_an_lp_base_ability_x) . the auto-negotiation protocol is a purely physical layer activity and proceeds independently of the mac controller. the following blocks are activated during an auto-negotiation session: ? auto-negotiation (digital) ? 100m adc (analog) ? 100m pll (analog) ? 100m equalizer/blw/clock recovery (dsp) ? 10m squelch (analog) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 96 smsc lan9313/lan9313i datasheet ? 10m pll (analog) ? 10m tx driver (analog) auto-negotiation is started by the occurrence of any of the following events: ? power-on reset (por) ? hardware re set (nrst) ? phy software reset (via reset control regi ster (reset_ctl) , or bit 15 of the port x phy basic control register (p hy_basic_control_x) ) ? phy power-down reset ( section 7.2.9, "phy power-down modes," on page 99 ) ? phy link status down (bit 2 of the port x phy basic status register (phy_basic_status_x) is cleared) ? setting the port x phy basic control re gister (phy_basic_control_x) , bit 9 high (auto-neg restart) ? digital reset (via bit 0 of the reset control regi ster (reset_ctl) ) ? issuing an eeprom loader reload command ( section 8.2.4, "eeprom loader," on page 117 ) note: refer to section 4.2, "resets," on page 43 for information on thes e and other system resets. on detection of one of these events, the phy begins auto-negotiation by transmitting bursts of fast link pulses (flp). these are bursts of link pulses from the 10m tx driver. they are shaped as normal link pulses and can pass uncorrupted down cat-3 or cat-5 cable. a fast link pulse burst consists of up to 33 pulses. the 17 odd-numbered pulses, which are always present, frame the flp burst. the 16 even-numbered pulses, which may be present or absent, contain the data word being transmitted. presence of a data pulse represents a 1, while absence represents a 0. the data transmitted by an flp burst is known as a link code word. these are defined fully in ieee 802.3 clause 28. in summary, the phy advertises 802.3 compliance in its selector field (the first 5 bits of the link code word). it advertises its technology ability according to the bits set in the port x phy auto-negotiation advertisement register (phy_an_adv_x) . there are 4 possible matches of the technology abilities. in the order of priority these are: ? 100m full duplex (highest priority) ? 100m half duplex ? 10m full duplex ? 10m half duplex (lowest priority) if the full capabilities of the phy are advertised (100 m, full-duplex), and if the link partner is capable of 10m and 100m, then auto-negotiation selects 100m as the highest performance mode. if the link partner is capable of half and full-duplex modes, then auto-negotiation selects full-duplex as the highest performance mode. once a speed and duplex match has been determined, the link code words are repeated with the acknowledge bit set. any difference in the main content of the link code words at this time will cause auto-negotiation to re-start. auto-n egotiation will also re-start if al l of the required flp bursts are not received. writing the port x phy auto-negotiation adve rtisement register (phy_an_adv_x) bits [8:5] allows software control of the capabilities advertised by the phy. writing the port x phy auto-negotiation advertisement register (phy_an_adv_x) does not automatically re-start auto-negotiation. the port x phy basic control regist er (phy_basic_control_x) , bit 9 must be set before the new abilities will be advertised. auto-negotiation can also be disabled via software by clearing bit 12 of the port x phy basic control regist er (phy_basic_control_x) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 97 revision 2.0 (02-14-13) datasheet 7.2.5.1 phy pause flow control the port 1 & 2 phys are capable of generating and receiving pause flow control frames per the ieee 802.3 specification. the phys advertised pause flow control abilities are set via bits 10 (symmetric pause) and 11 (asymmetric pause) of the port x phy auto-negotiation advertisement register (phy_an_adv_x) . this allows the phy to advertise its fl ow control abilities and auto-negotiate the flow control settings with its link partner. the default values of these bits are determined via configuration straps as defined in section 13.2.2.5, "port x phy auto-negotiation advertisement register (phy_an_adv_x)," on page 243 . the pause flow control settings may also be manually set via the manual flow control registers port 1 manual flow control register (manual_fc_1) and port 2 manual flow control register (manual_fc_2) . these registers allow the swit ch fabric ports flow control settings to be manually set when auto-negotiation is disabled or the manual flow control select bit 0 is set. the currently enabled duplex and flow control settings can also be monitored via these registers. the flow control values in the port x phy auto-negotiation advertisement register (phy_an_adv_x) are not affected by the values of the manual flow control register. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. 7.2.5.2 parallel detection if the lan9313/lan9313i is connected to a device lacking the ability to auto-negotiate (i.e. no flps are detected), it is able to determine the speed of the link based on either 100m mlt-3 symbols or 10m normal link pulses. in this case the link is presumed to be half -duplex per the ieee 802.3 standard. this ability is known as parallel detecti on. this feature ensures interoperability with legacy link partners. if a link is formed via parallel detection, then bit 0 in the port x phy auto-negotiation expansion register (phy_an_exp_x) is cleared to indicate that the link partner is not capable of auto- negotiation. if a fault occurs during parallel detection, bit 4 of the port x phy auto-negotiation expansion register (phy_an_exp_x) is set. the port x phy auto-negotiation link partner base page ability register (phy_an_lp_base_ability_x) is used to store the link partner ability information, which is coded in the received flps. if the link partner is not auto-negotiation capable, then this register is updated after completion of parallel detection to refl ect the speed capability of the link partner. 7.2.5.3 restarting auto-negotiation auto-negotiation can be re-started at any time by setting bit 9 of the port x phy basic control register (phy_basic_control_x) . auto-negotiation will also re-start if the link is broken at any time. a broken link is caused by signal loss. this may occur because of a cable break, or because of an interruption in the signal transmitted by the link partner. auto-negotiation resumes in an attempt to determine the new link configuration. if the management entity re-starts auto-negotiation by writing to bit 9 of the port x phy basic control register (phy_basic_control_x) , the lan9313/lan9313i will respond by stopping all transmission/receiving operations. once the internal break link time of approximately 1200ms has passed in the auto-negotiation state-machine, the auto-negotiation will re-start. in this case, the link partner will have also dropped the link due to lack of a received signal, so it too will resume auto- negotiation. 7.2.5.4 disabling auto-negotiation auto-negotiation can be disabled by clearing bit 12 of the port x phy basic control register (phy_basic_control_x) . the phy will then force its speed of operation to reflect the speed (bit 13) and duplex (bit 8) of the port x phy basic control register (phy_basic_control_x) . the speed and duplex bits in the port x phy basic control register (phy_basic_control_x) should be ignored when auto-negotiation is enabled. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 98 smsc lan9313/lan9313i datasheet 7.2.5.5 half vs. full-duplex half-duplex operation relies on the csma/cd (carrier sense multiple access / collision detect) protocol to handle network traffic and collisions. in this mode, the carrier sense signal, crs, responds to both transmit and receive activity. if data is received while the phy is transmitting, a collision results. in full-duplex mode, the phy is able to transmit and receive data simultaneously. in this mode, crs responds only to receive activity. the csma/cd pr otocol does not apply and collision detection is disabled. 7.2.6 hp auto-mdix hp auto-mdix facilitates the use of cat-3 (10 base-t) or cat-5 (100 base-t) media utp interconnect cable without consideration of interface wiring scheme. if a user plugs in either a direct connect lan cable or a cross-over patch cable, as shown in figure 7.4 (see note 7.1 on page 88 ) , the phy is capable of configuring the txpx/txnx and r xpx/rxnx twisted pair pins for correct transceiver operation. the internal logic of the device detects the tx and rx pins of the connecting device. since the rx and tx line pairs are interchangeable, special pcb design considerations are needed to accommodate the symmetrical magnetics and termination of an auto-mdix design. the auto-mdix function can be disabled through bit 15 (amdixctrl) of the port x phy special control/status indication regist er (phy_special_con trol_stat_ind_x) . when amdixctrl is cleared, auto-mdix can be selected via the auto_mdix_strap_x configuration strap. the mdix can also be configured manually via the manual_mdix_strap_x if both the amdixctrl bit and the auto_mdix_strap_x configuration strap are low. refer to section 3.2, "pin descriptions," on page 29 for more information on the configuration straps. when bit 15 (amdixctrl) of the port x phy special control/status indication register (phy_special_control_stat_ind_x) is set to 1, the auto-mdix capability is determined by bits 13 and 14 of the port x phy special control/status indication register (phy_special_control_stat_ind_x) . 7.2.7 mii mac interface the mii mac interface is responsible for the transmission and reception of the ethernet data to and from the switch fabric mac. the phy is connected internally to the switch fabric mac via standard mii signals per ieee 802.3. figure 7.4 direct cable connection vs. cross-over cable connection 12 3 4 5 6 7 8 txpx txnx rxpx not used not used rxnx not used not used 12 3 4 5 6 7 8 txpx txnx rxpx not used not used rxnx not used not used direct connect cable rj-45 8-pin straight-through for 10base-t/100base-tx signaling 12 3 4 5 6 7 8 txpx txnx rxpx not used not used rxnx not used not used 12 3 4 5 6 7 8 txpx txnx rxpx not used not used rxnx not used not used cross-over cable rj-45 8-pin cross-over for 10base-t/100base-tx signaling downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 99 revision 2.0 (02-14-13) datasheet for a transmission, the switch fabric mac drives the transmit data onto the internal mii txd bus and asserts txen to indicate valid data. the data is in the form of 4-bit wide data at a rate of 25mhz for 100base-tx, or 2.5mhz for 10base-t. for reception, the 4-bit data nibbles are sent to the mii mac interface block. these data nibbles are clocked to the controller at a ra te of 25mhz for 100base-tx, or 2.5mhz for 10base-t. rxclk is the output clock for the internal mii bus. it is recovered from the received data to clock the rxd bus. if there is no received signa l, it is derived from the system reference clock. 7.2.8 phy management control the phy management control block is responsib le for the management functions of the phy, including register access and interrupt generation. a serial management interface (smi) is used to support registers 0 through 6 as required by the ieee 802.3 (clause 22), as well as the vendor specific registers allowed by the specification. the smi interface consists of the mii management data (mdio) signal and the mii management clock (mdc) signal. these signals interface to the mdio and mdc pins of the lan9313/lan9313i (or the pmi block in i 2 c and spi modes of operation) and allow access to all phy registers. refer to section 13.2.2, "port 1 & 2 phy registers," on page 235 for a list of all supported registers and register descriptions. non-supported registers will be read as ffffh. 7.2.8.1 phy interrupts the phy contains the ability to generate various interrupt events as described in ta b l e 7 . 3 . reading the port x phy interrupt source flags register (phy_interrupt_source_x) shows the source of the interrupt, and clears the interrupt signal. the port x phy interrupt mask register (phy_interrupt_mask_x) enables or disables each phy interrupt. the phy management control block aggregates the enabled interrupts status into an internal signal which is sent to the system interrupt controller and is reflected via the interrupt status register (int_sts) bit 26 (phy_int1) for the port 1 phy, and bit 27 (phy_int2) for the port 2 phy. for more information on the lan9313/lan9313i interrupts, refer to chapter 5, "system interrupts," on page 55 . 7.2.9 phy power-down modes there are two power-down modes for the phy: ? phy general power-down ? phy energy detect power-down note: for more information on the various power management features of the lan9313/lan9313i, refer to section 4.3, "power management," on page 53 . table 7.3 phy interrupt sources interrupt source phy_interrupt_mask_x & phy_interrupt_source_x register bit # energyon activated 7 auto-negotiation complete 6 remote fault detected 5 link down (link status negated) 4 auto-negotiation lp acknowledge 3 parallel detection fault 2 auto-negotiation page received 1 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 100 smsc lan9313/lan9313i datasheet note: the power-down modes of each phy (port 1 phy and port 2 phy) are controlled independently. note: the phy power-down modes do not reload or reset the phy registers. 7.2.9.1 phy general power-down this power-down mode is controlled by bit 11 of the port x phy basic control register (phy_basic_control_x) . in this mode the entire phy, except the phy management control interface, is powered down. the phy will remain in this power-down state as long as bit 11 is set. when bit 11 is cleared, the phy powers up and is automatically reset. 7.2.9.2 phy energy detect power-down this power-down mode is enabled by setting bit 13 (edpwrdown) of the port x phy mode control/status register (phy_mode_control_status_x) . when in this mode, if no energy is detected on the line, the entire phy is powered down except for the phy management control interface, the squelch circuit, and the energyon logic. the energyon logic is used to detect the presence of valid energy from 100base- tx, 10base-t, or auto-negotiation signals and is responsible for driving the energyon signal (bit 1) of the port x phy mode control/status register (phy_mode_control_status_x) . in this mode, when the energyon signal is cleared, the phy is powered down and no data is transmitted from the phy. when energy is received, via link pulses or packets, the energyon signal goes high, and the phy powers up. the phy automatically resets itself into its previous state prior to power-down, and asserts the int7 interrupt (bit 7) of the port x phy interrupt source flags register (phy_interrupt_source_x) . the first and possibly second packet to activate energyon may be lost. when bit 13 (edpwrdown) of the port x phy mode control/status register (phy_mode_control_status_x) is low, energy detect power-down is disabled. 7.2.10 phy resets in addition to the chip-level hardware reset (nrst) and power-on reset (por), the phy supports three block specific resets. these are discussed in the following sections. for detailed information on all lan9313/lan9313i resets and the reset sequence refer to section 4.2, "resets," on page 43 . note: the digital_rst bit in the reset control register (reset_ctl) does not reset the phys. only a hardware reset (nrst) or an eeprom reload command will automatically reload the configuration strap values into the phy registers. for all other phy resets, these values will need to be manually configured via software. 7.2.10.1 phy software reset via reset_ctl the phy can be reset via the reset control register (reset_ctl) . the port 1 phy is reset by setting bit 1 (phy1_rst), and the port 2 phy is reset by setting bit 2 (phy2_rst). these bits are self clearing after approximately 102us. this reset does not reload the configuration strap values into the phy registers. 7.2.10.2 phy software reset via phy_basic_ctrl_x the phy can also be reset by setting bit 15 (phy_rst) of the port x phy basic control register (phy_basic_control_x) . this bit is self clearing and will return to 0 after the reset is complete. this reset does not reload the configuration strap values into the phy registers. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 101 revision 2.0 (02-14-13) datasheet 7.2.10.3 phy power-down reset after the phy has returned from a power-down state, a reset of the phy is automatically generated. the phy power-down modes do not reload or reset the phy registers. refer to section 7.2.9, "phy power-down modes," on page 99 for additional information. 7.2.11 leds each phy provides led indication signals to the gpio/led block of the lan9313/lan9313i. this allows external leds to be used to indicate va rious phy related functions such as tx/rx activity, speed, duplex, or link status. refer to chapter 12, "gpio/led controller," on page 146 for additional information on the configuration of these signals. 7.2.12 required ethernet magnetics the magnetics selected for use with the lan9313/lan9313i should be an auto-mdix style magnetic, which is widely available from several vendors. please review the smsc application note 8.13 suggested magnetics for the latest qualified and suggested magnetics. a list of vendors and part numbers are provided within the application note. 7.3 virtual phy the virtual phy provides a basic mii management interface (mdio) to the mii management pins per the ieee 802.3 (clause 22) so that a mac with an unmodified driver can be supported as if the mac was attached to a single port phy. this functionality is designed to allow easy and quick integration of the lan9313/lan9313i into designs with minimal driver modifications. the virtual phy provides a full bank of registers which comply with the ieee 802.3 sp ecification. this enables the virtual phy to provide various status and control bits similar to those provided by a real phy. these include the output of speed selection, duplex, loopback, isolate, collision test, and auto-negotiation status. for a list of all virtual phy registers and related bit descriptions, refer to section 13.2.1, "virtual phy registers," on page 235 . 7.3.1 virtual phy auto-negotiation the purpose of the auto-negotiation function is to automatically configure the virtual phy to the optimum link parameters based on the capabilities of its link partner. because the virtual phy has no actual link partner, the auto-negotiation process is emulated with deterministic results. auto-negotiation is enabled by setting bit 12 (vphy_an) of the virtual phy basic control register (vphy_basic_ctrl) and is restarted by the occurrence of any of the following events: ? power-on reset (por) ? hardware re set (nrst) ? phy software reset (via bit 3 of the reset control register (reset_ctl) , or bit 15 of the virtual phy basic control regi ster (vphy_basic_ctrl) ) ? setting the virtual phy basic control register (vphy_basic_ctrl) , bit 9 high (auto-neg restart) ? digital reset (via bit 10 of the reset control register (reset_ctl) ) ? issuing an eeprom loader reload command ( section 8.2.4, "eeprom loader," on page 117 ) the emulated auto-negotiation process is much simpler than the real process and can be categorized into three steps: 1. bit 5 (auto-negotiation complete) is set in the virtual phy basic status register (vphy_basic_status) . 2. bit 1 (page received) is set in the virtual phy auto-negotiation expansion register (vphy_an_exp) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 102 smsc lan9313/lan9313i datasheet 3. the auto-negotiation result (speed and duplex) is determined and registered. the auto-negotiation result (speed and duplex) is determined using the highest common denominator (hcd) of the virtual phy auto-negotiation adve rtisement register (vphy_an_adv) and virtual phy auto-negotiation link partner base page ability regist er (vphy_an_lp_base_ability) as specified in the ieee 802.3 standard . the technology ability bits of these registers are anded, and if there are multiple bits in common, the priority is determined as follows: ? 100mbps full duplex (highest priority) ? 100mbps half duplex ? 10mbps full duplex ? 10mbps half duplex (lowest priority) for example, if the full capabilities of the virt ual phy are advertised (100mbps, full duplex), and if the link partner is capable of 10mbps and 100mbps, then auto-negotiation selects 100mbps as the highest performance mode. if the link partner is capable of half and full-duplex modes, then auto- negotiation selects full-duplex as the highest performance operation. in the event that there are no bits in common, an emulated parallel detection is used. the virtual phy auto-negotiation adve rtisement register (vphy_an_adv) defaults to having all four ability bits set. these values can be reconfigured via software. once the auto-negotiation is complete, any change to the virtual phy auto-negotiation advert isement register (vphy_an_adv) will not take affect until the auto-negotiation process is re-run. the emulated link partner default advertised abilities in the virtual phy auto-negotiation link partner base page ability register (vphy_an_lp_base_ability) are dependant on the mii_duplex pin and the duplex_pol_strap_mii and speed_strap_mii configuration straps as described in table 13.6 of section 13.1.7.6, "virtual phy auto-negotiation link partner base page abilit y register (vphy_an_lp_base_ability)," on page 222 . neither the virtual phy or the emulated link partner support next page capability, remote faults, or 100base-t4. note: the mii_duplex, duplex_pol_strap_mii, and sp eed_strap_mii inputs are considered to be static. auto-negotiation is not automatically re-evaluated if these inputs are changed. if there is at least one common selection between the emulated link partner and the virtual phy advertised abilities, then the auto-negotiation succeeds, the link partner auto-negotiation able bit 0 of the virtual phy auto-negotiation ex pansion register (vphy_an_exp) is set, and the technology ability bits in the virtual phy auto-negotiation link partner base page ability register (vphy_an_lp_base_ability) are set to indicate the emulated link partners abilities. note: for the virtual phy, the auto-negotiation register bits (and management of such) are used by the pmi. so the perception of local and link partner is reversed. the local device is the pmi, while the link partner is the switch fabric. this is consistent with the intention of the virtual phy. 7.3.1.1 parallel detection in the event that there are no common bits betw een the advertised ability and the emulated link partners ability, auto-negotiation fails and emulated parallel detect is used. in this case, the link partner auto-negotiation able (bit 0) in the virtual phy auto-negotiation expansion register (vphy_an_exp) will be cleared, and the communication set to half-duplex. the speed is determined by the speed_strap_mii configuration strap. only one of the technology ability bits in the virtual phy auto-negotiation link part ner base page ability regi ster (vphy_an _lp_base_ability) will be set, indicating the emulated parallel detect result. 7.3.1.2 disabling auto-negotiation auto-negotiation can be disabled in the virtual phy by clearing bit 12 (vphy_an) of the virtual phy basic control register (vphy_basic_ctrl) . the virtual phy will then force its speed of operation to reflect the speed (bit 13) and duplex (bit 8) of the virtual phy basic control register (vphy_basic_ctrl) . the speed and duplex bits in the virtual phy basic control register (vphy_basic_ctrl) should be ignored when auto-negotiation is enabled. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 103 revision 2.0 (02-14-13) datasheet 7.3.1.3 virtual phy pause flow control the virtual phy supports pause flow control per the ieee 802.3 specification. the virtual phys advertised pause flow control abilities are set via bits 10 (symmetric pause) and 11 (asymmetric pause) of the virtual phy auto-negotiation advertisement register (vphy_an_adv) . this allows the virtual phy to advertise its flow control abilities and auto-negotiate the flow control settings with the emulated link partner. the default values of these bits are as shown in section 13.1.7.5, "virtual phy auto-negotiation advertisement register (vphy_an_adv)," on page 220 . the symmetric/asymmetric pause ability of the em ulated link partner is based upon the advertised pause flow control abilities of the virtual phy in (bits 10 & 11) of the virtual phy auto-negotiation advertisement register (vphy_an_adv) . thus, the emulated link partner always accommodates the asymmetric/symmetric pause ability settings requested by the virtual phy, as shown in ta b l e 1 3 . 5 , emulated link partner pause flow control ability default values, on page 223 . the pause flow control settings ma y also be manually set via the port 0(external mii) manual flow control register (manual_fc_mii) . this register allows the switch fabric port 0 flow control settings to be manually set when auto-negotiation is disabled or the manual flow control select bit 0 is set. the currently enabled duplex and flow control settings can also be monitored via this register. the flow control values in the virtual phy auto-negotiation adve rtisement register (vphy_an_adv) are not affected by the values of the manual flow control register. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. 7.3.2 virtual phy in mac modes in the mac modes of operation, an external phy is connected to the mii interface of the lan9313/lan9313i. because there is an external phy present, the virtual phy is not needed for external configuration. however, the port 0 switch fabric mac still requires the proper duplex setting. therefore, in mac mode, if the auto-negotiation bit (vphy_an) of the virtual phy basic control register (vph y_basic_ctrl) is set, the duplex is based on the mii_duplex pin and duplex_pol_strap_mii configuration strap. if these signals are equal, the port 0 switch fabric mac is configured for full-duplex, otherwise it is set for half-duplex. the mii_duplex pin is typically connected to the duplex indication of the external phy. the duplex is not latched since the auto-negotiation process is not used. the duplex can be manually selected by clearing the auto-negotiation bit (vphy_an) and controlling the duplex mode (vphy_duplex) bit in the virtual phy basic control register (vphy_basic_ctrl) . note: in mac modes, the virtual phy registers are accessible through their memory mapped registers via the smi, spi, or i 2 c serial management interfaces only. the virtual phy registers are not accessible through mii management. 7.3.2.1 full-duplex flow control in the mac modes of operation, the virtual phy is not applicable. therefore, full-duplex flow control should be controlled manually by the host via the port 0(external mii) manual flow control register (manual_fc_mii) , based on the external phys auto-negotiation results. 7.3.3 virtual phy resets in addition to the chip-level hardware reset (nrst) and power-on reset (por), the virtual phy supports two block specific resets. these are is discussed in the following sections. for detailed information on all lan9313/lan9313i resets, refer to section 4.2, "resets," on page 43 . 7.3.3.1 virtual phy soft ware reset via reset_ctl the virtual phy can be reset via the reset control register (reset_ctl) by setting bit 3 (vphy_rst). this bit is self clearing after approximately 102us. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 104 smsc lan9313/lan9313i datasheet 7.3.3.2 virtual phy software reset via vphy_basic_ctrl the virtual phy can also be reset by setting bit 15 (vphy_rst) of the virtual phy basic control register (vphy_basic_ctrl) . this bit is self clearing and will return to 0 after the reset is complete. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 105 revision 2.0 (02-14-13) datasheet chapter 8 serial management 8.1 functional overview this chapter details the serial management functionality provided by the lan9313/lan9313i, which includes the eeprom i 2 c/microwire master, eeprom loader, spi slave, and i 2 c slave controllers. the i 2 c/microwire eeprom controller is an i 2 c/microwire master module which interfaces an optional external eeprom with the system register bus and the eeprom loader. multiple types (i 2 c/microwire) and sizes of external eeproms ar e supported. configuration of the eeprom type and size are accomplished via the eeprom_type_strap and eeprom_size_strap[1:0] configuration straps respectively. various commands are supported for each eeprom type, allowing for the storage and retrieval of static data. the i 2 c interface conforms to the philips i 2 c-bus specification . the eeprom loader provides the aut omatic loading of co nfiguration settings from the eeprom into the lan9313/lan9313i at reset, allowing the lan9313/lan9313i to operate unmanaged. the eeprom loader module interfaces to the eeprom co ntroller, ethernet phys, and the system csrs. the spi/i 2 c slave controller can be used for cpu serial management and allows cpu access to all system csrs. the spi slave controlle r supports single register and mu ltiple register read and write commands. the i 2 c slave controller implements the low level i 2 c slave serial interface (start and stop condition detection, data bit transmission/reception, and acknowledge generation/reception), handles the slave command protocol, and performs system register read s and writes. the i 2 c slave controller conforms to the philips i 2 c-bus specification . 8.2 i 2 c/microwire master eeprom controller based on the configuration strap eeprom_type_strap, the i 2 c/microwire eeprom controller supports either microwire or i 2 c compatible eeproms. the i 2 c/microwire serial management pins functionality and characteristics differ dependant on the selected eeprom type as summarized in ta b l e 8 . 1 . note: when the eeprom loader is running, it has exclusive use of the i 2 c/microwire eeprom controller. refer to section 8.2.4, "eeprom loader" for more information. table 8.1 i 2 c/microwire master serial ma nagement pins characteristics eeprom type/mode ee_sda/eedi pin eedo pi n eecs pin ee_scl/eeclk pin i 2 c master eeprom mode eeprom_type_strap = 1 ee_sda input enabled (to i 2 c master) open-drain output (from i 2 c master) pull-down disabled not used input enabled (used for straps) output enabled (driven low) not used input enabled (used for straps) output enabled (driven low) ee_scl input enabled (to i 2 c master and used for straps) open-drain output (from i 2 c master) microwire master eeprom mode eeprom_type_strap = 0 eedi input enabled (to microwire master) output disabled pull-down enabled eedo input enabled (used for straps) output enabled (from microwire master) eecs input enabled (used for straps) output enabled (from microwire master) eeclk input enabled (used for straps) output enabled (from microwire master) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 106 smsc lan9313/lan9313i datasheet 8.2.1 eeprom controller operation i 2 c and microwire master eeprom operations are performed using the eeprom command register (e2p_cmd) and eeprom data register (e2p_data) . in microwire eeprom mode, the following operations are supported: ? erase (erase location) ? eral (erase all) ? ewds (erase/write disable) ? ewen (erase/write enable) ? read (read location) ? write (write location) ? wral (write all) ? reload (eeprom loader reload - see section 8.2.4, "eeprom loader" ) note: in i 2 c eeprom mode, only a sub-set of the above commands (read, write, and reload) are supported. note: the eeprom loader uses the read command only. the supported commands of each mode are detailed in section 13.1.3.1, "eeprom command register (e2p_cmd)," on page 164 . details specific to each eeprom controller mode (i 2 c and microwire) are explained in section 8.2.2, "i2c eeprom" and section 8.2.3, "microwire eeprom" respectively. when issuing a write, or wral command, the desired data must first be written into the eeprom data register (e2p_data) . the write or wral command may then be issued by setting the epc_command field of the eeprom command register (e2p_cmd) to the desired command value. if the operation is a write, the epc_address field in the eeprom command register (e2p_cmd) must also be set to the desired location. the command is executed when the epc_busy bit of the eeprom command register (e2p_cmd) is set. the completion of the operation is indicated when the epc_busy bit is cleared. when issuing a read command, the epc_ command and epc_address fields of the eeprom command register (e2p_cmd) must be configured with the desired command value and the read address, respectively. the read command is executed by setting the epc_busy bit of the eeprom command register (e2p_cmd) . the completion of the operation is indicated when the epc_busy bit is cleared, at which time the data from the eeprom may be read from the eeprom data register (e2p_data) . other eeprom operations (ewds, ewen, erase, eral, reload) are performed by writing the appropriate command into the epc_command field of the eeprom command register (e2p_cmd) . the command is executed by setting the epc_busy bit of the eeprom command register (e2p_cmd) . in all cases, the software must wait for the epc_busy bit to clear before modifying the eeprom command register (e2p_cmd) . note: the eeprom device powers-up in the erase/write disabled state. to modify the contents of the eeprom, the ewen command must first be issued. if an operation is attempted and the eeprom device does not respond within 30ms, the lan9313/lan9313i will time-out, and the epc_timeou t bit of the eeprom command register (e2p_cmd) will be set. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 107 revision 2.0 (02-14-13) datasheet figure 8.1 illustrates the process required to perform an eeprom read or write operation. 8.2.2 i 2 c eeprom the i 2 c master implements a low level serial interface (start and stop condition generation, data bit transmission and reception, acknowledge generation and reception) for connection to i 2 c eeproms, and consists of a data wire (ee_sda) and a serial clock (ee_scl). the serial clock is driven by the master, while the data wire is bi-directional. both signals are open-drain and require external pull-up resistors. the serial clock is also used as an input as it can be held low by the slave device in order to wa it- state the data cycle. once the slave has data available or is ready to receive, it will release the clock. assuming the masters clock low time is also expired, the clock will rise and the cycle will continue. in the event that the slave device holds the clock low for more than 30ms, the current command sequence is aborted and the epc_timeout bit in the eeprom command register (e2p_cmd) is set. both the clock and data signals have schmitt trigger inputs and digital input filters. the digital filters reject pulses that are less than 100ns. note: since the i 2 c master is designed to access eeprom only, multi-master arbitration is not supported. based on the configuration strap ee prom_size_strap, various sized i 2 c eeproms are supported. the varying size ranges are supporte d by additional bits in the address field (epc_address) of the eeprom command register (e2p_cmd) . within each size range, the largest eeprom uses all the address bits, while the smaller eeproms treat the upper address bits as dont cares. the eeprom figure 8.1 eeprom ac cess flow diagram eeprom write idle write e2p_data register write e2p_cmd register read e2p_cmd register epc_busy = 0 eeprom read idle write e2p_cmd register read e2p_cmd register read e2p_data register epc_busy = 0 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 108 smsc lan9313/lan9313i datasheet controller drives all the address bits as requeste d regardless of the actual size of the eeprom. the supported size ranges for i 2 c operation are shown in ta b l e 8 . 2 . note 8.1 bits in the control byte are used as the upper address bits. the i 2 c master interface runs at the standard-mode ra te of 100khz and is fully compliant with the philips i 2 c-bus specification . refer to the he philips i 2 c-bus specification for detailed timing information. 8.2.2.1 i 2 c protocol overview i 2 c is a bi-directional 2-wire data protocol. a device that sends data is defined as a transmitter and a device that receives data is defined as a receiver. the bus is controlled by a master which generates the ee_scl clock, controls bus access, and generates the start and stop conditions. either the master or slave may operate as a transmitter or receiver as determined by the master. the following bus states exist: ? idle: both ee_sda and ee_scl are hi gh when the bus is idle. ? start & stop conditions: a start condition is defined as a high to low transition on the ee_ sda line while ee_ scl is high. a stop condition is defined as a low to high transition on the ee_sda line while ee_scl is high. the bus is considered to be busy following a start condition and is considered free 4.7us/1.3us (for 100khz and 400khz operation, respectively) following a stop condition. the bus stays busy following a repeated start condition (instead of a stop condition). starts and repeated starts are otherwise functionally equivalent. ? data valid: data is valid, following the start condition, when ee_sda is stable while ee_scl is high. data can only be changed while the clock is low. there is one valid bit per clock pulse. every byte must be 8 bits long and is transmitted msb first. ? acknowledge: each byte of data is followed by an acknowledge bit. the master generates a ninth clock pulse for the acknowledge bit. the transmitter releases ee_sda (high). the receiver drives ee_sda low so that it remains valid during the high period of the clock, taking into account the setup and hold times. the receiver may be the master or the slave depending on the direction of the data. typically the receiver acknowledges each byte. if the master is the receiver, it does not generate an acknowledge on the last byte of a transfer. this informs the slave to not drive the next byte of data so that the master may generate a stop or repeated start condition. table 8.2 i 2 c eeprom size ranges eeprom_size_stra p[0] # of address bytes eeprom size eeprom types 01 ( note 8.1 ) 16 x 8 through 2048 x 8 24xx00, 24xx01, 24xx02, 24xx04, 24xx08, 24xx16 1 2 4096 x 8 through 65536 x 8 24xx32, 24xx64, 24xx128, 24xx256, 24xx512 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 109 revision 2.0 (02-14-13) datasheet figure 8.2 displays the various bus states of a typical i 2 c cycle. 8.2.2.2 i 2 c eeprom device addressing the i 2 c eeprom is addressed for a read or write op eration by first sending a control byte followed by the address byte or bytes. the control byte is preceded by a start condition. the control byte and address byte(s) are each acknowledged by the eepr om slave. if the eeprom slave fails to send an acknowledge, then the sequence is aborted and the epc_timeout bit of the eeprom command register (e2p_cmd) is set. the control byte consists of a 4-bit control code, 3-bits of chip/blo ck select and one direction bit. the control code is 1010b. for single byte addressing eeproms, the chip/block select bits are used for address bits 10, 9, and 8. for double byte addres sing eeproms, the chip/b lock select bits are set low. the direction bit is set low to indicate the address is being written. figure 8.3 illustrates typical i 2 c eeprom addressing bit order for single and double byte addressing. 8.2.2.3 i 2 c eeprom byte read following the device addressing, a da ta byte may be read from th e eeprom by outputting a start condition and control byte with a control code of 1010b, chip/block select bits as described in section 8.2.2.2 , and the r/~w bit high. the eeprom will respond with an ackn owledge, followed by 8-bits of data. if the eepr om slave fails to send an acknowledg e, then the sequence is aborted and the epc_timeout bit in the eeprom command register (e2p_cmd) is set. the i 2 c master then sends a no-acknowledge, followed by a stop condition. figure 8.2 i 2 c cycle figure 8.3 i 2 c eeprom addressing ee_sda ee_scl s start condition p stop condition data valid or ack data valid or ack data stable data can change data stable data can change sr re-start condition data can change data can change s 1 0 1 0 a 10 a 9 a 8 0 r/~w control byte a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 a c k a c k chip / block select bits s 1 0 1 0 0 control byte a c k a c k single byte addressing double byte addressing a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 a c k address byte address low byte address high byte a 9 a 8 0 0 0 a 15 a 14 a 13 a 12 a 11 a 10 r/~w chip / block select bits downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 110 smsc lan9313/lan9313i datasheet figure 8.4 illustrates typical i 2 c eeprom byte read for single and double byte addressing. for a register level description of a read operation, refer to section 8.2.1, "eeprom controller operation," on page 106 . 8.2.2.4 i 2 c eeprom sequential byte reads following the device addressing, data bytes may be read sequentially from the eeprom by outputting a start condition and control byte with a control code of 1010b, chip/block sele ct bits as described in section 8.2.2.2 , and the r/~w bit high. the eeprom will respond with an ackn owledge, followed by 8-bits of data. if the eepr om slave fails to send an acknowledg e, then the sequence is aborted and the epc_timeout bit in the eeprom command register (e2p_cmd) is set. the i 2 c master then sends an acknowledge, and the eeprom responds with the next 8-bits of data. this continues until the last desired byte is read, at which point the i 2 c master sends a no-acknowledge, followed by a stop condition. figure 8.4 illustrates typical i 2 c eeprom sequential byte reads for single and double byte addressing. sequential reads are used by the eeprom loader. refer to section 8.2.4, "eeprom loader" for additional information. for a register level description of a read operation, refer to section 8.2.1, "eeprom controller operation," on page 106 . figure 8.4 i 2 c eeprom byte read figure 8.5 i 2 c eeprom sequenti al byte reads s 1 0 1 0 a 10 a 9 a 8 control byte a c k s 1 0 1 0 control byte a c k single byte addressing read double byte addressing read 0 0 0 1 data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k p 1 data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k p a c k a c k r/~w chip / block select bits r/~w chip / block select bits s 1 0 1 0 a 10 a 9 a 8 control byte a c k s 1 0 1 0 control byte a c k single byte addressing sequential reads 0 0 0 1 data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k p 1 data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k a c k a c k data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k p a c k data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k data byte d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 double byte addressing sequential reads ... r/~w chip / block select bits r/~w chip / block select bits ... downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 111 revision 2.0 (02-14-13) datasheet 8.2.2.5 i 2 c eeprom byte writes following the device addressing, a data byte may be written to the eeprom by outputting the data after receiving the acknowledge from the eeprom. the data byte is acknowledged by the eeprom slave and the i 2 c master finishes the write cycle with a st op condition. if the eeprom slave fails to send an acknowledge, then the sequence is aborted and the epc_timeout bit in the eeprom command register (e2p_cmd) is set. following the data byte write cycle, the i 2 c master will poll the eeprom to determine when the byte write is finished. a start condition is sent followed by a control byte with a control code of 1010b, chip/block select bits low, and the r/~w bit low. if the eeprom is finished with the byte write, it will respond with an acknowledge. otherwise, it will respond with a no-acknowledge and the i 2 c master will repeat the poll. if the acknowledge does not occur within 30ms, a time-out occurs. once the i 2 c master receives the acknowledge, it concludes by sending a start condition, followed by a stop condition, which will place the eeprom into standby. figure 8.4 illustrates typical i 2 c eeprom byte write. for a register level description of a write operation, refer to section 8.2.1, "eeprom controller operation," on page 106 . figure 8.6 i 2 c eeprom byte write a c k data byte p a c k s 1 0 1 0 0 control byte 0 0 0 s 1 0 1 0 0 0 0 0 s 1 0 1 0 0 0 0 0 ... d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 a c k a c k a c k s p poll cycle poll cycle poll cycle data cycle conclude r/~w chip / block select bits r/~w chip / block select bits r/~w chip / block select bits control byte control byte downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 112 smsc lan9313/lan9313i datasheet 8.2.3 microwire eeprom based on the configurat ion strap eeprom_type_ strap, various sized microwire eeproms are supported. the varying size ranges are suppor ted by additional bits in the address field (epc_address) of the eeprom command register (e2p_cmd) . within each si ze range, the largest eeprom uses all the address bits, while the smaller eeproms trea t the upper address bits as dont cares. the eeprom controller drives all the address bits as req uested regardless of the actual size of the eeprom. the supported size ranges for microwire operation are shown in ta b l e 8 . 3 . refer to section 14.5.4, "microwire timing," on page 396 for detailed microwire timing information. 8.2.3.1 microwire master commands ta b l e 8 . 4 , ta b l e 8 . 5 , and ta b l e 8 . 6 detail the microwire command set, including the number of clock cycles required, for 7, 9, and 11 address bits respectively. these commands are detailed in the following sections as well as in section 13.1.3.1, "eeprom command register (e2p_cmd)," on page 164 . table 8.3 microwire eeprom size ranges eeprom_size_strap[1:0] # of address bits eeprom size eeprom types 00 7 128 x 8 93xx46a 01 9 256 x 8 and 512 x 8 93xx56a, 93xx66a 10 11 1024 x 8 and 2048 x 8 93xx76a, 93xx86a 11 reserved table 8.4 microwire command set for 7 address bits inst start bit opcode address data to eeprom data from eeprom # of clocks erase 1 11 a6 a5 a4 a3 a2 a1 a0 - (rdy/~bsy) 10 eral 1 00 1 0 x x x x x - (rdy/~bsy) 10 ewds 1 00 0 0 x x x x x - hi-z 10 ewen 1 00 1 1 x x x x x - hi-z 10 read 1 10 a6 a5 a4 a3 a2 a1 a0 - d7 - d0 18 write 1 01 a6 a5 a4 a3 a2 a1 a0 d7 - d0 (rdy/~bsy) 18 wral 1 00 0 1 x x x x x d7 - d0 (rdy/~bsy) 18 table 8.5 microwire command set for 9 address bits inst start bit opcode address data to eeprom data from eeprom # of clocks erase 1 11 a8 a7 a6 a5 a4 a3 a2 a1 a0 - (rdy/~bsy) 12 eral 1 00 1 0 x x x x x x x - (rdy/~bsy) 12 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 113 revision 2.0 (02-14-13) datasheet 8.2.3.2 erase (erase location) if erase/write operations are en abled in the eeprom, th is command will erase the location selected by the epc_address field of the eeprom command register (e2p_cmd) . the epc_timeout bit is set if the eeprom does not respond within 30ms. ewds 1 00 0 0 x x x x x x x - hi-z 12 ewen 1 00 1 1 x x x x x x x - hi-z 12 read 1 10 a8 a7 a6 a5 a4 a3 a2 a1 a0 - d7 - d0 20 write 1 01 a8 a7 a6 a5 a4 a3 a2 a1 a0 d7 - d0 (rdy/~bsy) 20 wral 1 00 0 1 x x x x x x x d7 - d0 (rdy/~bsy) 20 table 8.6 microwire comma nd set for 11 address bits inst start bit opcode address data to eeprom data from eeprom # of clocks erase 1 11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 - (rdy/~bsy) 14 eral 1 00 1 0 x x x x x x x x x - (rdy/~bsy) 14 ewds 1 00 0 0 x x x x x x x x x -h i - z1 4 ewen 1 00 1 1 x x x x x x x x x -h i - z1 4 read 1 10 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 -d 7 - d 02 2 write 1 01 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 d7 - d0 (rdy/~bsy) 22 wral 1 00 0 1 x x x x x x x x x d7 - d0 (rdy/~bsy) 22 figure 8.7 eeprom erase cycle table 8.5 microwire command set for 9 address bits (continued) inst start bit opcode address data to eeprom data from eeprom # of clocks 1 eeclk eedi eedo eecs 11 ax a0 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 114 smsc lan9313/lan9313i datasheet 8.2.3.3 eral (erase all) if erase/write operat ions are enabled in the eeprom, this comm and will initiate a bulk erase of the entire eeprom. the epc_t imeout bit of the eeprom command register (e2p_cmd) is set if the eeprom does not respond within 30ms. 8.2.3.4 ewds (erase/write disable) after this command is issued, the eeprom will ignore erase and write commands. to re-enable erase/write operations, the ewen command must be issued. figure 8.8 eeprom eral cycle figure 8.9 eeprom ewds cycle 0 10 10 eeclk eedi eedo eecs 0 10 00 eeclk eedi eedo eecs downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 115 revision 2.0 (02-14-13) datasheet 8.2.3.5 ewen (erase/write enable) this command enables the eeprom for erase and write operations . the eeprom will allow erase and write operations until the ewds command is sent, or until power is cycled. note: the eeprom will power-up in the erase/write di sabled state. any erase or write operations will fail until an ewen command is issued. 8.2.3.6 read (read location) this command will cause a read of the eeprom location pointed to by the epc_address field of the eeprom command register (e2p_cmd) . the result of the read is available in the eeprom data register (e2p_data) . figure 8.10 eeprom ewen cycle figure 8.11 eeprom read cycle 0 10 11 eeclk eedi eedo eecs 1 10 ax a0 d7 d0 eeclk eedi eedo eecs downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 116 smsc lan9313/lan9313i datasheet 8.2.3.7 write (write location) if erase/write operations are en abled in the eeprom, this command will cause the contents of the eeprom data register (e2p_data) to be written to the eeprom location pointed to by the epc_address field of the eeprom command register (e2p_cmd) . the epc_timeout bit of the eeprom command regi ster (e2p_cmd) is set if the eeprom does not respond within 30ms. 8.2.3.8 wral (write all) if erase/write operations are en abled in the eeprom, this command will cause the contents of the eeprom data register (e2p_data) to be written to every eeprom memory location. the epc_timeout bit of the eeprom command register (e2p_cmd) is set if the eeprom does not respond within 30ms. figure 8.12 eeprom write cycle figure 8.13 eeprom wral cycle 0 11 ax a0 d7 d0 eeclk eedi eedo eecs 0 1 d7 d0 0 01 eeclk eedi eedo eecs downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 117 revision 2.0 (02-14-13) datasheet 8.2.4 eeprom loader the eeprom loader interfaces to the i 2 c/microwire eeprom controller, the phys, and to the system csrs (via the register access mux). all system csrs are accessible to the eeprom loader. the eeprom loader runs upon a pin reset (nrst), power-on reset (por), digital reset (digital_rst bit in the reset control regi ster (reset_ctl) ), or upon the issuance of a reload command via the eeprom command register (e2p_cmd) . refer to section 4.2, "resets," on page 43 for additional information on the lan9313/lan9313i resets. the eeprom contents must be loaded in a spec ific format for use wi th the eeprom loader. an overview of the eeprom cont ent format is shown in ta b l e 8 . 7 . each section of eeprom contents is discussed in detail in the following sections. 8.2.4.1 eeprom loader operation upon a pin reset (nrst), power-on reset (por ), digital reset (dig ital_rst bit in the reset control register (reset_ctl) ), or upon the issuance of a reload command via the eeprom command register (e2p_cmd) , the epc_busy bit in the eeprom command register (e2p_cmd) will be set. while the eeprom loader is active, the ready bit of the hardware configuration register (hw_cfg) is cleared and no writes to the lan9313/lan9313i should be attempted. the operational flow of the eeprom loader can be seen in figure 8.14 . table 8.7 eeprom cont ents format overview eeprom address description value 0 eeprom valid flag a5h 1 mac address low word [7:0] 1 st byte on the network 2 mac address low word [15:8] 2 nd byte on the network 3 mac address low word [23:16] 3 rd byte on the network 4 mac address low word [31:24] 4 th byte on the network 5 mac address high word [7:0] 5 th byte on the network 6 mac address high word [15:8] 6 th byte on the network 7 configuration strap values valid flag a5h 8 - 11 configuration strap values see table 8.8 12 burst sequence valid flag a5h 13 number of bursts see section 8.2.4.5, "register data" 14 and above burst data see section 8.2.4.5, "register data" downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 118 smsc lan9313/lan9313i datasheet figure 8.14 eeprom loader flow diagram byte 0 = a5h n digital_rst, nrst, por, reload n y epc_busy = 1 read byte 0 read bytes 1-6 write bytes 1-6 into switch mac address registers read bytes 7-11 byte 7 = a5h y write bytes 8-11 into configuration strap registers update phy registers update vphy registers update led_cfg, manual_fc_1, manual_fc_2 and manual_fc_mii registers read byte 12 byte 12 = a5h perform register data load loop y load phy registers with current straps load phy registers with current straps n epc_busy = 0 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 119 revision 2.0 (02-14-13) datasheet 8.2.4.2 eeprom valid flag following the release of nrst, por, digital_ rst, or a reload co mmand, the eeprom loader starts by reading the first byte of data from the eepr om. if the value of a5h is not read from the first byte, the eeprom loader will load the current configuration strap values into the phy registers (see section 8.2.4.4.1 ) and then terminate, clearing the epc_busy bit in the eeprom command register (e2p_cmd) . otherwise, the eeprom loader will cont inue reading sequential bytes from the eeprom. 8.2.4.3 mac address the next six bytes in the eeprom, after the eeprom valid flag, are written into the switch fabric mac address high register (switch_mac_addrh) and switch fabric mac address low register (switch_mac_addrl) . the eeprom bytes are written into the mac address registers in the order specified in ta b l e 8 . 7 . 8.2.4.4 soft-straps the 7 th byte of data to be read from the eeprom is the configuration strap va lues valid flag. if this byte has a value of a5h, the next 4 bytes of data (8-11) are written into the configuration strap registers per the assignments detailed in table 8.8 . if the flag byte is not a5h, these next 4 bytes are skipped (they are still read to maintain the data burst, bu t are discarded). however, the current configuration strap values are still loaded into the phy registers (see section 8.2.4.4.1 ). refer to section 4.2.4, "configuration straps," on page 47 for more information on the lan9313/lan9313i configuration straps. 8.2.4.4.1 phy regi sters synchronization some phy register defaults are based on configuration straps. in order to maintain consistency between the updated configuration strap registers and the phy registers, the port x phy auto- negotiation advertisement register (phy_an_adv_x) , port x phy special modes register (phy_special_modes_x) , and port x phy basic control regi ster (phy_basic_control_x) are written when the eeprom loader is run. the port x phy auto-negotiation advertisement register (phy_an_adv_x) is written with the new defaults as detailed in section 13.2.2.5, "port x phy auto-negotiation advertisement register (phy_an_adv_x)," on page 243 . the port x phy special modes re gister (phy_special_modes_x) is written with the new defaults as detailed in section 13.2.2.9, "port x phy special mo des register (phy_ special_modes_x)," on page 250 . the port x phy basic control regi ster (phy_basic_control_x) is written with the new defaults as detailed in section 13.2.2.1, "port x phy basic cont rol register (phy_ basic_control_x)," on page 237 . additionally, the restart auto-negotiation bit is set in this register. this re-runs the auto- negotiation using the new default values of the port x phy auto-negotiation advertisement register (phy_an_adv_x) register to determine the new auto-negotiation results. table 8.8 eeprom configuration bits b y t e / b i t765 4 321 0 byte 8 bp_en_ strap_1 fd_fc_ strap_1 manual_ fc_strap_1 manual_mdix _strap_1 auto_mdix_ strap_1 speed_ strap_1 duplex_ strap_1 autoneg_ strap_1 byte 9 bp_en_ strap_2 fd_fc_ strap_2 manual_ fc_strap_2 manual_mdix _strap_2 auto_mdix_ strap_2 speed_ strap_2 duplex_ strap_2 autoneg_ strap_2 byte 10 led_fun_strap[1:0] bp_en_ strap_mii fd_fc_ strap_mii manual_fc _strap_mii speed_ strap_mii duplex_pol_ strap_mii sqe_test_ disable_strap _mii byte 11 led_en_strap[7:0] downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 120 smsc lan9313/lan9313i datasheet note: each of these phy registers is written in its entirety, overwriting any previously changed bits. 8.2.4.4.2 virtual phy registers synchronization some phy register defaults are based on configuration straps. in order to maintain consistency between the updated configuration strap registers and the virtual phy registers, the virtual phy auto- negotiation advertisement register (vphy_an_adv) , virtual phy special control/status register (vphy_special_control_status) , and virtual phy basic control register (vphy_basic_ctrl) are written when the eeprom loader is run. the virtual phy auto-negotiation advert isement register (vphy_an_adv) is written with the new defaults as detailed in section 13.1.7.5, "virtual phy auto-negotiation advertisement register (vphy_an_adv)," on page 220 . the virtual phy special control/status r egister (vphy_special_control_status) is written with the new defaults as detailed in section 13.1.7.8, "virtual phy special control/status register (vphy_special_control_status)," on page 226 . the virtual phy basic control register (vphy_basic_ctrl) is written with the new defaults as detailed in section 13.1.7.1, "virtual phy basic control register (vphy_basic_ctrl)," on page 214 . additionally, the restart auto-negotiation bit is set in this register. this re-runs the auto-negotiation using the new default values of the virtual phy auto-negotiation advertisement register (vphy_an_adv) register to determine the new auto-negotiation results. note: each of these vphy registers is written in its entirety, overwriting any previously changed bits. 8.2.4.4.3 led and manual flow control register synchronization since the defaults of the led configuration register (led_cfg) , port 1 manual flow control register (manual_fc_1) , port 2 manual flow control register (manual_fc_2) , and port 0(external mii) manual flow control register (manual_fc_mii) are based on configur ation straps, the eeprom loader reloads these registers with their new default values. 8.2.4.5 register data optionally following the configuration strap val ues, the eeprom data may be formatted to allow access to the lan9313/lan9313i parallel, directly wr itable registers. access to indirectly accessible registers (e.g. switch engine registers, etc.) is achievable with an appropriate sequence of writes (at the cost of eeprom space). this data is first preceded with a burst sequence valid flag (eeprom byte 12). if this byte has a value of a5h, the data that fo llows is recognized as a sequence of bursts. otherwise, the eeprom loader is finished, will go into a wait state, and clear the epc_busy bit in the eeprom command register (e2p_cmd) . this can optionally generate an interrupt. the data at eeprom byte 13 and above should be formatted in a se quence of bursts. the first byte is the total number of bursts. following this is a se ries of bursts, each consisting of a starting address, count, and the count x 4 bytes of data. this results in the following formula f or formatting register data: 8-bits number_of_bursts repeat (number_of_bursts) 16-bits {starting_address[9:2] / count[7:0]} repeat (count) 8-bits data[31:24], 8-bits data[23:16], 8-bits data[15:8], 8-bits data[7:0] note: the starting address is a dword address. appendi ng two 0 bits will form the register address. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 121 revision 2.0 (02-14-13) datasheet as an example, the following is a 3 burst sequence, with 1, 2, and 3 dwords starting at register addresses 40h, 80h, and c0h respectively: a5h, (burst sequence valid flag) 3h, (number_of_bursts) 16{10h, 1h}, (starting_address1 divided by 4 / count1) 11h, 12h, 13h, 14h, (4 x count1 of data) 16{20h, 2h}, (starting_address2 divided by 4 / count2) 21h, 22h, 23h, 24h, 25h, 26h, 27h, 28h, (4 x count2 of data) 16{30h, 3h}, (starting_address3 divided by 4 / count3) 31h, 32h, 33h, 34h, 35h, 36h, 37h, 38h, 39h, 3ah, 3bh, 3ch (4 x count3 of data) in order to avoid overwriting the switch csr r egister interface or the phy management interface (pmi), the eeprom loader waits until the csr busy bit of the switch fabric csr interface command register (switch_csr_cmd) and the mii busy bit of the phy management interface access register (pmi_access) are cleared before performing any register write. the eeprom loader checks that the eeprom address sp ace is not exceeded. if so, it will stop and set the eeprom loader addre ss overflow bit in the eeprom command register (e2p_cmd) . the address limit is based on the eeprom_size_strap wh ich specifies a range of sizes. the address limit is set to the largest value of the specified range. 8.2.4.6 eeprom loader finished wait-state once finished with the last burst, the eeprom loader will go into a wait-state and the epc_busy bit of the eeprom command register (e2p_cmd) will be cleared. 8.2.4.7 reset sequen ce and eeprom loader in order to allow the eeprom load er to change the port 1/2 phys and virtual phy strap inputs and maintain consistency with the phy and virtual phy registers, the following sequence is used: 1. after power-up or upon a ha rdware reset (nrst), the st raps are sampled into the lan9313/lan9313i as specified in section 14.5.2, "reset and configuration strap timing," on page 394 . 2. after the pll is stable, the main chip rese t is released and the eeprom loader reads the eeprom and configures (overrides) the strap inputs. 3. the eeprom loader writes select port 1/2 and virtual phy registers, as specified in section 8.2.4.4.1 and section 8.2.4.4.2 , respectively. note: step 3 is also performed in the case of a reload command or digital reset. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 122 smsc lan9313/lan9313i datasheet 8.3 spi/i 2 c slave controller the spi/i 2 c slave controller functionality is dependant on the management mode of the lan9313/lan9313i. when in mac/phy i 2 c managed modes, the i 2 c controller is enabled. when in mac/phy spi managed modes, the spi controller is enabled. the spi/i 2 c serial management pins functionality and characteristics differ dependant on the selected modes as summarized in ta b l e 8 . 9 . details on the various management modes and their configuration settings are provided in section 2.3, "modes of operation," on page 24 . 8.4 spi slave operation when in mac/phy spi managed mode, the spi slave interface is used for cpu management of the lan9313/lan9313i. all system csrs are access ible to the cpu in these modes. spi mode is selected when the mngt_mode_strap[1:0] inputs are set to 11b. the spi slave interface supports single register and multiple register read and write commands. multiple read and multiple write commands support incrementing, decrementing, and static addressing. input data on the si pin is sampled on the rising edge of the sck input clock. output data is sourced on the so pin with the falling edge of the clock. the sck input clock can be either an active high pulse or an active low pulse. when the nscs chip select input is high, the si input pin is ignored and the so output pin is three-stated. a read or write command is started on the first rising edge of the input clock after nscs goes low. an 8-bit instruction is then driven onto the line followed by an 8-bit register address field. all registers are accessed as dwords. appending two 0 bits to the address field will form the register address. this is followed by one or more 32-bit data fields. al l registers are accessed as dwords. all instructions, addresses and data are transferred with the most-significant bit (msb) first. data is transferred with the most-significant byte (m sb) first (little endian). the spi interface supports up to a 10mhz input clock. a detailed spi timing diagram is provided in section 14.5.5, "spi slave timing," on page 397 . table 8.9 spi / i 2 c slave serial management pins characteristics mode(s) si/sda pin so pin nscs pin sck/scl pin mac/phy modes unmanaged mac/phy modes smi managed not used input disabled output disabled pull-up enabled not used output enabled (driven low) not used input disabled pull-up enabled not used input disabled pull-up enabled mac/phy modes spi managed si input to spi slave output disabled pull-up enabled so three-state output from spi slave nscs input to spi slave pull-up enabled sck input to spi slave pull-up enabled mac/phy modes i 2 c managed sda input to i 2 c slave open-drain output from i 2 c slave pull-up disabled not used output enabled (driven low) not used input disabled pull-up enabled scl input to i 2 c slave pull-up disabled downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 123 revision 2.0 (02-14-13) datasheet the spi instructions supported by the lan9313/lan9313i are listed in ta b l e 8 . 1 0 . unsupported instructions are must not be used. 8.4.1 spi read sequence the spi slave interface of the lan9313/lan9313i is selected for reads by first bringing nscs low. the si pin should then driven with an 8-bit read instruction, followed by the 8-bit address. on the falling clock edge which follows the rising edge of the last address bit, the so output is driven starting with the msb of the selected register. the remaining register bits are shifted out on subsequent falling clock edges. multiple reads are performed by continuing the clock pulses while nscs is low. depending on the instruction (as shown in table 8.10 ), the internal address is incremented, decremented, or maintained. maintaining a fixed internal address is useful for re gister polling. for auto-incrementing instructions, once the internal address reaches its maximum, it rolls over to 0. for auto-decrementing instructions, once the internal address reaches 0, it rolls over to its maximum. the nscs input is brought high to conclude the cycle. the so output pin is three-stated at this time. since data is read serially, register values are latched (registered) at the beginning of each 32-bit read to prevent the host from reading an intermediate val ue. the latching occurs multiple times in a multiple read sequence. in addition, any register that is affected by a read operation (e.g. a clear on read bit) is not cleared until after all 32-bits are output. in the event that 32-bits are not read when the nscs is returned high, the read is considered invalid and the register is not affected. multiple registers may be cleared in a multiple read cycle, each one being cleared as it is read. spi reads from unused register addresses return as all zeros. table 8.10 supported spi instructions instruction format description read 0000 0011 read register at the specified address. multiple reads mainta in the same address. read_inc 0000 0111 read register(s) starting at the specified address. multiple reads auto-increment address. read_dec 0000 1011 read register(s) starting at the specified address. multiple reads auto-decrement address. write 0000 0010 write register at the specified address. multiple writes maintain the same address. write_inc 0000 0110 write register(s) starting at the specified address. multiple writes auto-increment address. write_dec 0000 1010 write register(s) starting at the specified address. multiple writes auto-decrement address. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 124 smsc lan9313/lan9313i datasheet figure 8.1 illustrates a typical single and multiple register read. 8.4.1.1 spi read polling for reset complete during reset, the spi slave interface will not return valid data. to determine when the reset condition is complete, the byte order test register (byte_test) should be polled. once the correct pattern is read, the interface can be considered functional. at this point, the ready bit in the hardware configuration register (hw_cfg) can be polled to determine when the device initialization is complete. refer to section 4.2, "resets," on page 43 for additional information. 8.4.2 spi write sequence the spi slave interface of the lan9313/lan9313i is selected for writes by first bringing nscs low. the si pin should then driven with an 8-bit write instruction, followed by the 8-bit address and then the data. multiple writes are performed by continuing t he clock pulses and input data while nscs is low. depending on the instruction (as shown in ta b l e 8 . 1 0 ), the internal address is incremented, decremented, or maintained. maintaining an fixed internal address is useful for bit-banging. for auto- incrementing instructions, once the internal address reaches its maximum, it rolls over to 0. for auto- decrementing instructions, once the internal address reaches 0, it rolls over to its maximum. the nscs input is brought high to conclude the cycle. the so output is three-stated throughout the entire write sequence. the data write to the register occurs after the 32-bits are input. in the event that 32-bits are not written when the nscs is returned high, the write is considered invalid and the register is not affected. multiple registers may be written in a multiple writ e cycle, each one being written after 32-bits. spi writes must not be performed to unused register addresses. figure 8.1 spi reads single register read sck (active high) si 0000 1 x instruction 1 address x so a9 data x x a8 a7 a6 a5 a4 a3 a2 x multiple register reads nscs si 0000 1 x instruction dec 1 address x so a9 x inc a8 a7 a6 a5 a4 a3 a2 x 00 x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 45 46 47 48 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 x d 31 d 30 d 29 d2 d1 d0 d 31 d 30 d 29 d2 d1 d0 d 31 d 30 d 29 d2 d1 d0 data 1... z z z z x x nscs x x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 45 46 47 48 x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 x .. . .. . .. . .. . sck (active low) sck (active low) sck (active high) .. .. . . .. .. . . .. . .. . .. . .. . data m data m+1... data n downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 125 revision 2.0 (02-14-13) datasheet figure 8.2 illustrates a typical single and multiple register write. 8.5 i 2 c slave operation when in mac/phy i 2 c managed mode, the i 2 c slave interface is used for cpu management of the lan9313/lan9313i . all system csrs are accessible to the cpu in these modes. i 2 c mode is selected when the mngt_mode_strap[1:0] inputs are set to 10b. the i 2 c slave controller implements the low level i 2 c slave serial interface (start and stop condition detection, data bit transmission and reception, and acknowledge generation and reception), handl es the slave command protocol, and performs system register reads and writes. the i 2 c slave controller conforms to the philips i 2 c-bus specification . the i 2 c slave serial interface consists of a data wire (sda) and a serial clock (scl). the serial clock is driven by the master, while the data wire is bi -directional. both signals are open-drain and require external pull-up resistors. both signals include schmitt trigger inputs and digital input filters. the digital filters reject pulses that are less than 100ns. the i 2 c slave serial interface supports the standard-mode speed of up to 100khz and the fast-mode speed of 400khz. refer to the philips i 2 c-bus specification for detailed i 2 c timing information. 8.5.1 i 2 c slave command format the i 2 c slave serial interface supports single register and multiple register read and write commands. a read or write command is started by the master first sending a start condition, followed by a control byte. the control byte consists of a 7-bit slave address and a 1-bit read/write indication (r/~w). the slave address used by the lan9313/lan9313i is 0001 010b, written as sa6 (first bit on the wire) through sa0 (last bit on the wire). assuming the slave address in the control byte matches this address, the control byte is acknowledged by the lan9313/lan9313i. otherwise, the entire sequence is ignored until the next start condition. the i 2 c command format can be seen in figure 8.3 . figure 8.2 spi writes single register write 0000 1 x instruction 1 address a9 data x x a8 a7 a6 a5 a4 a3 a2 multiple register writes 0000 1 x instruction dec 1 address a9 x inc a8 a7 a6 a5 a4 a3 a2 00 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 45 46 47 48 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 x d 31 d 30 d 29 d2 d1 d0 x x d 31 d 30 d 29 d2 d1 d0 d 31 d 30 d 29 d2 d1 d0 z z x x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 45 46 47 48 x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 x .. . .. . .. . .. .. . . .. .. . . .. .. . . sck (active high) si so nscs sck (active low) sck (active high) si so nscs sck (active low) data 1... ...data m ...data m+1 ...data n downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 126 smsc lan9313/lan9313i datasheet if the read/write indication (r/~w) in the control byte is a 0 (indicating a potential write), the next byte sent by the master is the re gister address. after the address byte is acknowledged by the lan9313/lan9313i, the master may either send data bytes to be written, or it may send another start condition (to start the reading of data), or a stop condition. the latter two will terminate the current write (without writing any data), but will have the affe ct of setting the internal register address which will be used for subsequent reads. if the read/write indication in the control byte is a 1 (indicating a read), the lan9313/lan9313i will start sending data following the control byte acknowledgement. note: all registers are accessed as dwords. appending two 0 bits to the address field will form the register address. addresses and data are transferred msb first. data is transferred msb first (little endian). 8.5.2 i 2 c slave read sequence following the device addressing, as detailed in section 8.5.1 , a register is read from the lan9313/lan9313i when the master sends a start condition and control byte with the r/~w bit set. assuming the slave address in the control byte matches the lan9313/lan9313i address, the control byte is acknowledged by the lan9313/lan9313i. otherwise, the entire sequence is ignored until the next start condition. following the acknowledge, the lan9313/lan9313i sends 4 bytes of data. the first 3 bytes are acknowledged by the master and on the fourth, the master sends a no-acknowledge followed by the stop condition. the no-acknowledge informs the lan9313/lan9313i not to send the next 4 bytes (as it would in the case of a multiple read). the internal register address is unchanged following the single read. multiple reads are performed when the master sends an acknowledge on the fourth byte. the internal address is incremented and the next register is shifted out. once the internal address reaches its maximum, it rolls over to 0. the multiple read is concluded when the master sends a no-acknowledge followed by a stop condition. the no-acknowledge informs the lan9313/lan9313i not to send the next 4 bytes. the internal register address in incremented for each read including the final. for both single and multiple reads, in the case that the master sends a no-acknowledge on any of the first three bytes of the register, the lan9313/lan 9313i will stop sending subsequent bytes. if the master sends an unexpected start or stop c ondition, the lan9313/lan9313i will stop sending immediately and will respond to the next sequence as needed. since data is read serially, register values are latched (registered) at the beginning of each 32-bit read to prevent the host from reading an intermediate val ue. the latching occurs multiple times in a multiple read sequence. in addition, any register that is affected by a read operation (e.g. a clear on read bit) is not cleared until after all 32-bits are output. in the event that 32-bits are not read (master sends a no-acknowledge on one of the first three bytes or a start or stop condition occurs unexpectedly), the read is considered invalid and the register is no t affected. multiple registers may be cleared in a multiple read cycle, each one be ing cleared as it is read. i 2 c reads from unused register addresses return all zeros. figure 8.3 i 2 c slave addressing s sa 2 sa 1 sa 0 0 r/~w control byte a 7 a 6 a 5 a 4 a 3 a 2 a c k a c k address byte sa 6 sa 5 sa 4 sa 3 * start or stop or data [31] a 9 a 8 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 127 revision 2.0 (02-14-13) datasheet figure 8.4 illustrates a typical single and multiple register read. 8.5.2.1 i 2 c slave read polling for reset complete during reset, the i 2 c slave interface will not return valid data. to determine when the reset condition is complete, the byte order test register (byte_test) should be polled. once the correct pattern is read, the interface can be considered functional. at this point, the ready bit in the hardware configuration register (hw_cfg) can be polled to determine when the device initialization is complete. refer to section 4.2, "resets," on page 43 for additional information. 8.5.3 i 2 c slave write sequence following the device addressing, as detailed in section 8.5.1 , a register is written to the lan9313/lan9313i when the master continues to send data bytes. each byte is acknowledged by the lan9313/lan9313i. following the fourth byte of the sequence, the master may either send another start condition or halt the sequence with a stop condition. the internal register address is unchanged following a single write. multiple writes are performed when the master sends additional bytes following the fourth acknowledge. the internal address is automatically incremented and the next register is written. once the internal address reaches it maximum value, it rolls over to 0. the multiple write is concluded when the master sends another st art condition or stop condition. the internal register address is incremented for each write including the final. this is not relevant for subsequent writes, since a new register address would be included on a new write cycle. however, this does affect the internal register address if it were to be used for reads with out first resetting the register address. for both single and multiple writes, if the master sends an unexpected start or stop condition, the lan9313/lan9313i will stop immediately and will respond to the next sequence as needed. the data write to the register occurs after the 32-bits are input. in the event that 32-bits are not written (master sends a start, or a stop condition occurs un expectedly), the write is considered invalid and the register is not affected. multiple registers may be written in a multiple write cycle, each one being written after 32-bits. i 2 c writes must not be performed to unused register addresses. figure 8.4 i 2 c slave reads multiple register reads s control byte a c k single register read 1 d 5 d 4 d 3 d 2 d 1 d 0 a c k p sa 2 sa 1 sa 0 sa 6 sa 5 sa 4 sa 3 a c k d 31 d 30 d 29 d 28 s 27 d 26 d 25 d 24 d 23 d 22 s a c k 1 sa 2 sa 1 sa 0 sa 6 sa 5 sa 4 sa 3 a c k d 31 d 30 d 25 d 24 data byte... d 21 d 20 data byte data 1 byte d 4 d 3 d 2 d 1 d 0 a c k p d 4 d 3 d 2 d 1 d 0 a c k d 31 d 30 d 29 d 28 d 27 d 26 s sa 2 sa 1 sa 0 0 a 7 a 6 a 5 a 4 a 3 a 2 a c k a c k address byte sa 6 sa 5 sa 4 sa 3 a 9 a 8 s sa 2 sa 1 sa 0 0 control byte a 7 a 6 a 5 a 4 a 3 a 2 a c k a c k address byte sa 6 sa 5 sa 4 sa 3 a 9 a 8 r/~w r/~w .. . .. .. . .. . . control byte control byte ...data byte ...data m byte data m+1 byte... ...data n byte downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 128 smsc lan9313/lan9313i datasheet figure 8.5 illustrates a typical single and multiple register write. figure 8.5 i 2 c slave writes multiple register writes single register write a c k d 5 d 4 d 3 d 2 d 1 d 0 p d 31 d 30 d 29 d 28 s 27 d 26 d 25 d 24 d 23 d 22 d 21 d 20 data byte a c k a c k a c k d 31 d 30 d 25 d 24 d 5 d 4 d 3 d 2 d 1 d 0 p d 5 d 4 d 3 d 2 d 1 d 0 a c k d 31 d 30 d 29 d 28 d 27 d 26 d 25 a c k a c k s sa 2 sa 1 sa 0 0 a 7 a 6 a 5 a 4 a 3 a 2 a c k address byte sa 6 sa 5 sa 4 sa 3 a 9 a 8 s sa 2 sa 1 sa 0 0 a 7 a 6 a 5 a 4 a 3 a 2 a c k address byte sa 6 sa 5 sa 4 sa 3 a 9 a 8 control byte control byte data 1 byte .. .. . . ...data m byte data m+1 byte... .. . ...data n byte .. . ...data byte data byte... downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 129 revision 2.0 (02-14-13) datasheet chapter 9 mii management 9.1 functional overview this chapter details the mii management functionality provided by the lan9313 /lan9313i, which includes the smi slave controller , phy management interface (pmi) , and the mii mode mu ltiplexer . the smi slave controller is used for cpu management of the lan9313/lan9313i via the mii pins, and allows cpu access to all system csrs. the phy management interface (pmi) is used to access the internal phys and optional external phy, dependant on the management mode. the pmi implements the ieee 802.3 management protocol. the mii mode multiplexer is used to direct the connections of the mii data path and mii management path based on the selected mode of the device. 9.2 smi slave controller the smi slave controller uses the same pins and pr otocol as the ieee 802.3 mii management function, and differs only in that smi provides access to all internal registers by using a non-standard extended addressing map. the smi protocol co-exists with the mii management protocol by using the upper half of the phy address space (16 through 31). all direct and indirect registers of the lan9313/lan9313i can be accessed. the smi management mode is selected when the mngt_mode_strap[1:0] inputs are set to 01b. a list of management modes and their configuration settings are discussed in section 2.3, "modes of operation," on page 24 . the mii management protocol is limited to 16-bit data accesses. the protocol is also limited to 5 phy address bits and 5 register address bits. the smi frame format can be seen in table 9.1 . the lan9313/lan9313i uses the phy address field bits 3:0 as the system register address bits 9:6, and the register address field as the system register address bits 5:1. therefore, register address field bit 0 is used as the upper/lower word select. the lan9313/lan9313i requires two back-to-back accesses to each register (with alternate settings of register address field bit 0) which are combined to form a 32-bit access. the acce ss may be performed in any order. note: when accessing the lan9313/lan931 3i, the pair of cycles must be atomic. in this case, the first host smi cycle is performed to the lo w/high word and the second host smi cycle is performed to the high/low wo rd, forming a 32-bit transaction with no cycles to the lan9313/lan9313i in between. with the exception of register address field bit 0, all address and control bits must be th e same for both 16-bit cycles of a 32-bit transaction. input data on the mdio pin is sampled on the rising edge of the mdc input clock. output data is sourced on the mdio pin with the rising edge of the clock. the mdio pin is three-stated unless actively driving read data. a read or a write is performed using the frame format shown in ta b l e 9 . 1 . all addresses and data are transferred msb first. data bytes are transferred litt le endian. when register address bit 0 is 1, bytes 3 & 2 are selected with byte 3 occurring first. when register address bit 0 is 0, bytes 1 & 0 are selected with byte 1 occurring first. table 9.1 smi frame format preamble start op code phy address note 9.1 register address note 9.1 turn- around time note 9.2 data idle note 9.3 read 32 1s 01 10 1aaaa 9876 aaaaa 54321 z0 dddddddddddddddd 1111110000000000 5432109876543210 z write 32 1s 01 01 1aaaa 9876 aaaaa 54321 10 dddddddddddddddd 1111110000000000 5432109876543210 z downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 130 smsc lan9313/lan9313i datasheet note 9.1 phy address bit 4 is 1 for smi commands. ph y address 3:0 form system register address bits 9:6. the register address field forms the system register address bits 5:1 note 9.2 the turn-around time (ta) is used to avoid contention during a read cycle. for a read, the lan9313/lan9313i drives the second bit of the turn-around time to 0, and then drives the msb of the read data in the following clock cycle. for a write, the external host drives the first bit of the turn-around time to 1, the second bit of the turn-around time to 0, and then the msb of the write data in the following clock cycle. note 9.3 in the idle condition, the mdio output is three-stated and pulled high externally. note: the smi interface supports up to a 2.5mhz input clock. the mii/smi timing adheres to the ieee 802.3 specification. refer to the ieee 802.3 specification for detailed mii timing information. 9.2.1 read sequence in a read sequence, the host sends the 32-bit preamble , 2-bit start of frame, 2-bit op-code, 5-bit phy address, and the 5-bit register address. the next clock is the first bit of the turnaround time in which the lan9313/lan9313i continues to three-state mdio. on the next rising edge of mdc, the lan9313/lan9313i drives mdio low. for the next 16 rising edges, the lan9313/lan9313i drives the output data. on the final clock, the lan9313/lan9313i once again three-states mdio. the host processor is required to perform two consecutive 16-bit reads to complete a single dword transfer. no ordering requirements exist. the processor can access either the low or high word first, as long as the next read is performed from the other word. if a read to the same word is performed, the combined data read pair is invalid and should be re-read. this is not a fatal error. the lan9313/lan9313i will simply re set the read counters , and restart a new cycle on the next read. note: select registers are readable as 16-bit registers, as noted in their register descriptions. for these registers, only one 16-bit read may be performed without the need to read the other word. register values are latched (registered) at the beginning of each 16-bit read to prevent the host from reading an intermediate value. in addition, any register that is affected by a read operation, such as a clear on read bit, is not cleared until after the end of the second read. in the event that 32-bits are not read, the read in considered invalid and the register is not affected. any register that may change between two consecutive host read cycles and spans across two words, such as a counter, is latched (registered) at the beginning of the first read and held until after the second read has completed. this prevents the host from reading inconsistent data from the first and second half of a register. for example, if a counters value is 01ffh, the first half will be read as 01h. if the counter then changes to 0200h, the host would read 00h, resulting an the incorrect value of 0100h instead of either 01ffh or 0200h. note: smi reads from unused register addresses return all zeros. this differs from unused phy registers which leave mdio un-driven. 9.2.1.1 smi read polling for reset complete during reset, the smi slave interface will not return valid data. to determine when the reset condition is complete, the byte order test register (byte_test) should be polled. once the correct pattern is read, the interface can be considered functional. at this point, the ready bit in the hardware configuration register (hw_cfg) can be polled to determine when the device initialization is complete. refer to section 4.2, "resets," on page 43 for additional information. note: in the event that a reset condition terminates between halves of 16-bit read pair, the lan9313/lan9313i will not expe ct another 16-bit read to complete the dword cycle. only specific registers may be read during a reset. refer to section 4.2, "resets," on page 43 for additional information. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 131 revision 2.0 (02-14-13) datasheet 9.2.2 write sequence in a write sequence, the host sends the 32-bit preamb le, 2-bit start of frame, 2-bit op-code, 5-bit phy address, 5-bit register address, 2-bit turn-around time, and finally the 16-bits of data. the mdio pin is three-stated throughout the write sequence. the host processor is required to perform two contiguous 16-bit writes to complete a single dword transfer. no ordering requirement exists. the host may access either the low or high word f irst, as long as the next write is performed to the opposite word. if a write to the same word is performed, the device disregards the transfer. note: smi writes must not be performed to unused register addresses. 9.3 phy manageme nt interface (pmi) the phy management interface (pmi) is used to access the internal phys as well as the external phy on the mii pins (in mac modes only). the pmi operates at 2.5mhz, and implements the ieee 802.3 management protocol, providing read/write commands for phy configuration. a read or write is performed using the frame format shown in ta b l e 9 . 2 . all addresses and data are transferred msb first. data bytes are transferred little endian. note 9.4 the turn-around time (ta) is used to avoid bus contention during a read cycle. for a read, the external phy drives the second bit of the turn-around time to 0, and then drives the msb of the read data in the following cycle. for a write, the lan9313/lan9313i drives the first bit of the turnaround time to 1, the second bit of the turnaround time to 0, and then the msb of the write data in the following clock cycle. note 9.5 in the idle condition, the mdio output is three-stated and pulled high externally. the internal phys and optional external phy (in mac modes) are accessed via the phy management interface access register (pmi_access) and phy management interface data register (pmi_data) . these registers allow read and write operations to all phy registers. refer to section 13.1.6, "phy management interface (pmi)," on page 211 for detailed information on these registers. 9.3.1 eeprom loader ph y register access the pmi is also used by the eeprom loader to load the phy registers with various configuration strap values. the phy management interface a ccess register (pmi_access) and phy management interface data register (pmi_data) are also accessible as part of the register data burst sequence of the eeprom loa der. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. table 9.2 mii management frame format preamble start op code phy address register address turn- around time note 9.4 data idle note 9.5 read 32 1s 01 10 aaaaa rrrrr z0 dddddddddddddddd z write 32 1s 01 01 aaaaa rrrrr 10 dddddddddddddddd z downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 132 smsc lan9313/lan9313i datasheet 9.4 mii mode multiplexer the mii mode multiplexer is used to direct the mii data/management path connections. one master (mac via the mii pins, or pmi) is connected to the slaves (phy via mii pins, port 1/2 phys, virtual phy, and smi slave) dependant on the selected management mode of the lan9313/lan9313i. the mii mode multiplexer also performs the multiplexing of the read data signals from the slaves and controls the output enable of the mii pins. the following sections detail the operation of the mii mode multiplexer in each management mode. a list of management modes and their configuration settings are discussed in section 2.3, "modes of operation," on page 24 . 9.4.1 mac mode unmanaged in mac mode unmanaged, no external accesses to the lan9313/lan9313i are required. the mii multiplexer is disabled and the mii management pins are not driven. the virtual phy interface is accessi ble via the eeprom loader. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.1 details the mii multiplexer management path connections for this mode. figure 9.1 mii mux management path connections - mac mode unmanaged smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 133 revision 2.0 (02-14-13) datasheet 9.4.2 mac mode smi managed in mac mode smi managed, the internal phys and smi slave block are accessed via the mii management pins. the virtual phy and pmi are not used in this mode. the virtual phy interface is accessible via the smi slave or the eeprom loader. refer to section 9.2, "smi slave controller," on page 129 and section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.2 details the mii multiplexer management path connections for this mode. figure 9.2 mii mux management path connections - mac mode smi managed smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 134 smsc lan9313/lan9313i datasheet 9.4.3 mac mode i 2 c/spi managed in mac mode i 2 c or spi managed, the internal phys and the external phy are accessed via the pmi. the smi slave and the virtual phy are not used in these modes. the virtual phy and pmi interfaces are accessible via the i 2 c/spi slave interfaces or the eeprom loader. refer to section 8.3, "spi/i2c slave controller," on page 122 and section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.3 details the mii multiplexer management path connections for this mode. figure 9.3 mii mux management path connections - mac mode i 2 c/spi managed smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 135 revision 2.0 (02-14-13) datasheet 9.4.4 phy mode unmanaged in phy mode unmanaged, the virtual phy is accessed via the external mii management pins. the port 1/2 phys, smi slave, and the pmi are not used in this mode. the virtual phy interface is accessi ble via the eeprom loader. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.4 details the mii multiplexer management path connections for this mode. figure 9.4 mii mux management path connections - phy mode unmanaged smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 136 smsc lan9313/lan9313i datasheet 9.4.5 phy mode smi managed in phy mode smi managed, the internal phys, vi rtual phy, and smi slave block are accessed via the mii management pins. the pmi is not used in this mode. the virtual phy interface is accessible via the smi slave or the eeprom loader. refer to section 9.2, "smi slave controller," on page 129 and section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.2 details the mii multiplexer management path connections for this mode. figure 9.5 mii mux management path connections - phy mode smi managed smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 137 revision 2.0 (02-14-13) datasheet 9.4.6 phy mode i 2 c/spi managed in phy mode i 2 c or spi managed, the port 1/2 phys are accessed via the pmi, and the virtual phy is accessed via the external mii management pins. the smi slave is not used in these modes. the virtual phy and pmi parallel inte rfaces are accessible via the i 2 c/spi slave interfaces or the eeprom loader. refer to section 8.3, "spi/i2c slave controller," on page 122 and section 8.2.4, "eeprom loader," on page 117 for additional information. figure 9.3 details the mii multiplexer management path connections for this mode. figure 9.6 mii mux management path connections - phy mode i 2 c/spi managed smi slave mdi mdo mdio_ dir mdclk parallel master virtual phy mdi mdo mdio_ dir mdclk parallel slave phy2 mdi mdo mdio_ dir mdclk phy1 mdi mdo mdio_ dir mdclk management mode selection mii pins mdi mdo mdio_dir mdc_in mdc_ out mdc_dir management mode selection pmi mdi mdo mdclk parallel slave mdo_enn mdio mdc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 138 smsc lan9313/lan9313i datasheet chapter 10 ieee 1588 hardware time stamp unit 10.1 functional overview the lan9313/lan9313i provides ha rdware support for t he ieee 1588 precision time protocol (ptp), allowing clock synchronization with remote ethernet devices, packet time stamping, and time driven event generation. time stamping is supported on all ports, with an individual ieee 1588 time stamp module connected to each port via the mii bus. any port may function as a master or a slave clock per the ieee 1588 specification, and the lan9313/la n9313i as a whole may function as a boundary clock. a 64-bit tunable clock is provided that is used as the time source for all i eee 1588 time stamp related functions. an ieee 1588 clock/events block provides ieee 1588 clock comparison based interrupt generation and time stamp related gpio event generation. two lan9313/lan9313i gpio pins (gpio[8:9]) can be used to trigger a time stamp capture when configured as an input, or outpu t a signal from the gpio based on an ieee 1588 clock target compare event when configured as an output. section 10.1.2, "block diagram" describes the various ieee 15 88 related blo cks and how they interface to other lan9313/lan9313i functions. all features of the ieee 1588 hardware time stam p unit can be monitored and configured via their respective configuration and status registers. a de tailed description of all i eee 1588 csrs is included in section 13.1.4, "ieee 1588," on page 168 . 10.1.1 ieee 1588 ieee 1588 specifies a precision time protocol (ptp ) used by master and slave clock devices to pass time information in order to achieve clock synchronization. five network message types are defined: ? sync ? delay_req ? follow_up ? delay_resp ? management only the first four message types (sync, delay_ req, follow_up, delay_resp) are used for clock synchronization. using these messages, the protocol software may calculate the offset and network delay between time stamps, adjusting the slave clock frequency as needed . refer to the ieee 1588 protocol for message definitions and proper usage. a ptp domain is segmented into ptp sub-domains, which are then segmented into ptp communication paths. within each ptp communication path there is a maximum of one master clock , which is the source of time for each slave clock. the determination of which clock is the master and which clock(s) is(are) the slave(s) is not fixed, but determined by the i eee 1588 protocol. similarly, each ptp sub-domain may have only one master clock, referred to as the grand master clock. ptp communication paths are conceptually equivalent to ethernet collision domains and may contain devices which extend the network. however, unlike ethernet collision domains, the ptp communication path does not stop at a network swit ch, bridge, or router. this leads to a loss of precision when the network switch/bridge/router introduces a variable delay. boundary clocks are defined which conceptually bypass the switch/bridge/router (either physically or via device integration). essentially, a boundary clock acts as a slave to an upstream master, and as a master to a down stream slave. a boundary clock may contain multiple ports, but a maximum of one slave port is permitted. for more information on the ieee 1588 protocol, refer to the national institute of standards and technology ieee 1588 website: http://ieee1588.nist.gov/ downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 139 revision 2.0 (02-14-13) datasheet 10.1.2 block diagram the lan9313/lan9313i ieee 1588 implementation is illustrated in figure 10.1 , and consists of the following major function blocks: ? ieee 1588 time stamp these three identical blocks prov ide time stamping functions on all switch fabric ports. ? ieee 1588 clock this block provides a 64-bit tunable clock that is used as the time source for all ieee 1588 time stamp related functions. ? ieee 1588 clock/events this block provides ieee 1588 clo ck comparison-based interrupt gene ration and time stamp related gpio event generation. figure 10.1 ieee 158 8 block diagram 10/100 phy ethernet 10/100 phy mii ethernet ieee 1588 time stamp mii to external mac/phy ieee 1588 time stamp ieee 1588 time stamp sync / delay_req msg detect rx sync / delay_req msg detect tx clock capture rx src uuid capture rx sequence id capture rx irq flag clock capture tx src uuid capture tx sequence id capture tx irq flag rx tx tx: sync for master, delay_req for slave rx: delay_req for master, sync for slave host ieee 1588 clock 64 bit clock carry 32 bit accumulator 32 bit addend + inc host ieee 1588 clock events clock capture gpio8 irq flag gpio[8:9] (inputs) clock capture gpio9 irq flag 64 bit clock target irq flag compare >= 64 bit reload / add load / add gpio[8:9] (outputs) host switch fabric irq enables x9 to int_sts register irq flags port 2 port 0 port 1 mii downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 140 smsc lan9313/lan9313i datasheet 10.2 ieee 1588 time stamp the lan9313/lan9313i contains three identi cal ieee 1588 time stamp blocks as shown in figure 10.1 . these blocks are responsible for capturing the source uui d, sequence id, and current 64-bit ieee 1588 clock time upon detection of a sy nc or delay_req message type on their respective port. the mode of the clock (master or slave) determines which message is detected on receiv e and transmit. for slave clock operation, sync messages are detected on receive and delay_req messages on transmit. for master clock operation, delay_req messages are detected on receive and sync messages on transmit. follow_up, delay_resp and management packet types do not cause capture. each port may be individually configured as an ieee 1588 master or slave clock via the master/slave bits (m_ns_1 for port 1, mns_2 for port2, and m_ns_mii for port 0) in the 1588 configuration register (1588_config) . table 10.1 summarizes the message type dete ction under slave and master ieee 1588 clock operation. for ports 1 and 2, receive is defined as data from the phy (from the outside world) and transmit is defined as data to the phy. this is consistent with the point-of-view of where the partner clock resides (lan9313/lan9313i receives packets from the partner via the phy, etc.). for the time stamp module connected to the external mii port (port 0), the defi nition of transmit and receive is reversed. receive is defined as data from the switch fabric, while transmit is defined as data to the switch fabric. this is consistent with the point-of-view of where the partner clock resides (lan9313/lan9313i receives packets from the partner via the switch fabric, etc.). as defined by ieee 1588, and shown in figure 10.2 , the message time stamp point is defined as the leading edge of the first data bit following the start of frame delimiter (sfd). however, since the packet contents are not yet known, the time stamp can not yet be loaded into the capture register. therefore, the time stamp is first stored into a tem porary internal holding register at the start of every packet. table 10.1 ieee 1588 me ssage type detection ieee 1588 clock mode receive transmit slave (m_ns_x = 0) sync delay_req master (m_ns_x = 1) delay_req sync figure 10.2 ieee 1588 message time stamp point bit time 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 preamble octet ethernet start of frame delimiter first octet following start of frame message timestamp point downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 141 revision 2.0 (02-14-13) datasheet clock synchronization and hardware processing between the network data and the time stamp capture hardware causes the time stamp point to be slight ly delayed. the host soft ware can account for this delay, as it is fairly deterministic. table 10.2 details the time stamp capture delay as a function of the mode of operation. refer to chapter 7, "ethernet phys," on page 87 for details on these modes. once the packet type is matched, according to table 10.1 , and the frame check sequence (fcs) is verified, the following occurs: ? the time stamp is loaded into the corresponding ports capture registers: Con reception: port x 1588 clock high-dword receive capture register (1588_clock_hi _rx_capture_x) and port x 1588 clock low-d word receive capture register (1588_clock_lo_rx_capture_x) Con transmission: port x 1588 clock high-dword transmit capture register (1588_clock_hi_tx_capture_x) and port x 1588 clock low-dword transmit capture register (1588_clock_lo_tx_capture_x) ? the sequence id and source uuid are loaded into the corresponding ports registers: Con reception: port x 1588 sequence id, source uuid high-word receive capture register (1588_seq_id_src_uuid_hi_rx_capture_x) and port x 1588 source uuid low- dword receive capture register (1588_src_uuid_lo_rx_capture_x) Con transmission: port x 1588 sequence id, source uuid high-word transmit capture register (1588_seq_id_src_uuid_hi_tx_capture_x) and port x 1588 source uuid low-dword transmit capture register (1588_src_uuid_lo_tx_capture_x) ? the corresponding ma skable interrupt flag is set in the 1588 interrupt status and enable register (1588_int_sts_en) . (refer to section 10.6, "ieee 1588 interrupts," on page 144 for information on ieee 1588 interrupts.) note: packets that do not contain an integral number of octets are not considered valid and do not cause a capture. 10.2.1 capture locking the corresponding ports clock ca pture, sequence id, and source uuid registers can be optionally locked when a capture event occurs, preventing them from being overwritten until the host clears the corresponding interrupt flag in the 1588 interrupt status and enable register (1588_int_sts_en) . this is accomplished by setting the corresponding lock enable bit(s) in the 1588 configuration register (1588_config) . each port has two lock enable control bits within this register, which allow the receive and transmit portions of each port to be locked independently. in addition, a lock enable bit is provided for each time stamp enabled gpio (lock_enable_gpio_8 and lock_enable_gpio_9) which prevents the corresponding gpio clock capture registers from being overwritten when the gpio interrupt in 1588 interrupt status and enable register (1588_int_sts_en) is set. refer to section 13.1.4.22, "1588 configuration register (1588_config)," on page 189 for additional information on the capture locking related bits. table 10.2 time stamp capture delay mode of operation delay (+/- 10 ns) 100 mbps 30 ns 10 mbps 120 ns downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 142 smsc lan9313/lan9313i datasheet 10.2.2 ptp message detection in order to provide the most flexibility, loose packet type matching is used by the lan9313/lan9313i. this assumes that for all packets received with a valid fcs, only the mac destination address is required to qualify them as a ptp message. for ethernet, four multicast addresses are specified in the ptp protocol: 224.0.1.129 through 224.0.1.132. these map to ethernet mac addresses 01:00:5e:00:01:81 through 01:00:5e:00:01:84. each of these addresses has one enable bit per port in the 1588 configuration register (1588_config) which enables/disables the corresponding address as a ptp address on the specified port. in addition to the fixed addresses, a user defined (host programmable) ptp address may be input via the 1588 auxiliary mac address high-word register (1588_aux_mac_hi) and 1588 auxiliary mac address low-dword register (1588_aux_mac_lo) . the user defined address may be disabled/enabled as a ptp address on each port via the dedicated enable bits in the 1588 configuration register (1588_config) . a summary of the supported ptp multicast addresses and corresponding enable bits can be seen in table 10.3 . once a packet is determined to match a ptp destination address, it is further qualified as a sync or delay_req message type. on ethernet, ptp uses udp messages. within the udp payload is the ptp control byte (offset 32 starting at 0). this byte determines the message type: 0x00 for a sync message, 0x01 for a delay_req message. the udp payload starts at packet byte offset 42 (from 0) for untagged packets and at byte offset 46 for tagged packets. note: both tagged and untagged packets are supported. only ethernet ii packet encoding and ipv4 are supported. note: for proper routing of the ptp packets, the host must program an entry into the switch engine address logic resolution (alr) table. t he mac address should be one of the reserved multicast addresses in table 10.3 , with port 0(external mii) as a destination.the static and valid bits must also be set. refer to chapter 6, "switch fabric," on page 60 for more information. table 10.3 ptp multicast addresses ptp address corresponding mac address related enable bits in the 1588_config register 224.0.1.129 (primary) 01:00:5e:00:01:81 mac_pri_en_1 (port 1) mac_pri_en_2 (port 2) mac_pri_en_mii (port 0) 224.0.1.130 (alternate 1) 01:00:5e:00:01:82 mac_alt1_en_1 (port 1) mac_alt1_en_2 (port 2) mac_alt1_en_mii (port 0) 224.0.1.131 (alternate 2) 01:00:5e:00:01:83 mac_alt2_en_1 (port 1) mac_alt2_en_2 (port 2) mac_alt2_en_mii (port 0) 224.0.1.132 (alternate 3) 01:00:5e:00:01:84 mac_alt3_en_1 (port 1) mac_alt3_en_2 (port 2) mac_alt3_en_mii (port 0) user defined user defined address (1588_aux_mac_hi & 1588_aux_mac_lo registers) mac_user_en_1 (port 1) mac_user_en_2 (port 2) mac_user_en_mii (port 0) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 143 revision 2.0 (02-14-13) datasheet 10.3 ieee 1588 clock the 64-bit ieee 1588 clock is the time source for all ieee 1588 related functions of the lan9313/lan9313i. it is readable and writable by the host via the 1588 clock high-dword register (1588_clock_hi) and 1588 clock low-dword register (1588_clock_lo) . in order to accurately read this clock, a specia l procedure must be followed. since two dword reads are required to fully read the 64-bit clock, the possi bility exists that as the lower 32-bits roll over, a wrong intermediate value could be read. to prevent this, a snapshot register technique is used. when the 1588_clock_snapshot bit in the 1588 command register (1588_cmd) register is written with 1, the current value of the 1588 clock is saved, allowing it to be properly read. when writing a new value to the ieee 1588 clock, two 32-bit write cycles are required (one for each clock register) before the registers are affected. the writes may be in any orde r. however, caution must be observed when changing the clock value in a live environment as it will disrupt linear time. if the clock must be adjusted during operation of the 1588 protocol, it is preferred to adjust the addend value, effectively speeding-up or slowing-down the clock until the correct time is achieved. the 64-bit ieee 1588 clock consists of the 32-bit 1588 clock addend register (1588_clock_addend) that is added to a 32-bit accumulator every 100 mhz clock. upon overflow of the accumulator, the 64- bit ieee 1588 clock is incremented. the addend / accumulator pair form a high precision frequency divider which can be used to compensate for the inaccuracy of the reference crystal. the nominal frequency of the 64-bit ieee 1588 clock and the value of the addend are calculated as follows: freqclock = (addend / 2 32 ) * 100 mhz addend = (freqclock * 2 32 ) / 100 mhz typical values for the addend are shown in ta b l e 1 0 . 4 . these values should be adjusted based on the accuracy of the ieee 1588 clock compared to the master clock per the ptp protocol. the adjustment precision column of the table shows the percen tage change for the specified ieee 1588 clock frequency if the addend was to be incremented or decremented by 1. 10.4 ieee 1588 clock/events the ieee 1588 clock/events block is responsible for generating and controlling all ieee 1588 clock related events. a 64-bit comparator is included in this block wh ich compares the 64-bit ieee 1588 clock with a 64-bit clock target loaded in the 1588 clock target high-dword register (1588_clock_target_hi) and 1588 clock target low-dword register (1588_clock_target_lo) . table 10.4 typical ieee 1588 clock addend values ieee 1588 clock (freqclock) 1588_clock_addend (addend) adjustment precision % 33 mhz 547ae147h 7.1*10 -8 50 mhz 80000000h 4.7*10 -8 66 mhz a8f5c28fh 3.5*10 -8 75 mhz c0000000h 3.1*10 -8 90 mhz e6666666h 2.6*10 -8 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 144 smsc lan9313/lan9313i datasheet when the ieee 1588 clock equals the clock target, a clock event occurs which triggers the following: ? the maskable interrupt 1588_timer_int is set in the 1588 interrupt status and enable register (1588_int_sts_en) . ? the reload_add bit in the 1588 configuration register (1588_config) is checked to determine the new clock target behavior: Creload_add = 1: the new clock target is loaded from the 64-bit reload / add registers ( 1588 clock target reload high-dword register (1588_clock_target_reload_hi) and 1588 clock target reload/add low-dword register (1588_clock_target_reload_lo) ). Creload_add = 0: the clock target is incremented by the 1588 clock target reload/add low-dword register (1588_clock_target_reload_lo) . note: writing the ieee 1588 clock may cause the interrupt event to occur if the new ieee 1588 clock value is set equal to th e current clock target. the clock target reload function (reload_add = 1) allows the host to pre-load the next trigger time. the add function (reload_add = 0), allows for a repeatable event. when the clock target overflows, it will wrap around past 0, as will the 64-bit ieee 1588 clock. since the clock target and reload / add registers are 64-bits, they require two 32-bit write cycles, one to each half, before the registers are affected. the writes may be in any order. 10.5 ieee 1588 gpios in addition to time stamping ptp packets, the ieee 1 588 clock value can be save d into a set of clock capture registers based on the gpio[9:8] inputs. when configured as outputs, gpio[9:8] can be used to output a signal based on an ieee 1588 clock target compare event. refer to section 12.2.1, "gpio ieee 1588 timestamping," on page 147 for information on using gpio[9:8] for ieee 1588 time stamping functions. 10.6 ieee 1588 interrupts the ieee 1588 hardware time stamp unit provides multiple interrupt conditions. these include time stamp indication on the transmitter and receiver si de of each port, individual gpio[9:8] input time stamp interrupts, and a clock comparison event inte rrupt. all ieee 1588 interr upts are located in the 1588 interrupt status and enable register (1588_int_sts_en) and are fully maskable via their respective enable bits. refer to section 13.1.4.23, "1588 interrupt status and enable register (1588_int_sts_en)," on page 193 for bit-level definitions of all ieee 1588 interrupts and enables. all ieee 1588 interrupts are anded with their in dividual enable s and then ored, as shown in figure 10.1 , generating the 1588_evnt bit of the interrupt status register (int_sts) . when configured as an input, gpio[9:8] have the added functionality of clearing the clock target interrupt bit (1588_timer_int) of the 1588 interrupt status and enable register (1588_int_sts_en) on an active edge. gpio inputs must be active for greater than 40 ns to be recognized as clear events. for more information on ieee 1588 gpio in terrupts, refer to section 12.2.2, "gpio interrupts," on page 147 . refer to chapter 5, "system interrupts," on page 55 for additional information on the lan9313/lan9313i interrupts. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 145 revision 2.0 (02-14-13) datasheet chapter 11 general purpose timer & free-running clock this chapter details the lan9313/lan9313i general purpose timer (gpt) and the free-running clock. 11.1 general purpose timer the lan9313/lan9313i provides a 16-bit programmable general purpose timer that can be used to generate periodic system interrupts. the resolution of this timer is 100us. the gpt loads the general purpose timer count register (gpt_cnt) with the value in the gpt_load field of the general purpose timer configuration register (gpt_cfg) when the timer_en bit of the general purpose timer configuration register (gpt_cfg) is asserted (1). on a chip-level reset, or when the timer_en bit changes from asserted (1) to de-asserted (0), the gpt_load field is initialized to ffffh. the general purpose timer count register (gpt_cnt) is also initialized to ffffh on reset. software can write a pre-load value into the gpt_load field at any time (e.g. before or after the timer_en bit is asserted). once enabled, the gpt counts down until it reaches 0000h, or until a new pre-load value is written to the gpt_load field. at 0000h, the counter wraps around to ffffh, asserts the gpt interrupt status bit (gpt_int) in the interrupt status register (int_sts) , asserts the irq interrupt (if gpt_int_en is set in the interrupt status register (int_sts) ), and continues counting. gpt_int is a sticky bit. once this bit is asserted, it can only be cleared by writing a 1 to the bit. refer to section 5.2.5, "general purpose timer interrupt," on page 58 for additional information on the gpt interrupt. 11.2 free-running clock the free-running clock (frc) is a simple 32-bit up -counter that operates from a fixed 25mhz clock. the current frc value can be read via the free running 25mhz counter register (free_run) . on assertion of a chip-level reset, this counter is cleared to zero. on de-assertion of a reset, the counter is incremented once for every 25mhz clock cycle. when the maximum count has been reached, the counter rolls over to zeros. the frc does not generate interrupts. note: the free running counter can take up to 160ns to clear after a reset event. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 146 smsc lan9313/lan9313i datasheet chapter 12 gpio/led controller 12.1 functional overview the gpio/led controller provides 12 configurabl e general purpose input/output pins, gpio[11:0]. these pins can be individually configured to function as inputs, push-pull outputs, or open drain outputs and each is capable of interrupt generation with conf igurable polarity. two of the gpio pins (gpio[9:8]) can be used for ieee 1588 timestamp functions, allowing gpio driven 1588 time clock capture when configured as an input, or gpio output generation based on an i eee 1588 clock target compare event. in addition, 8 of the gpio pins can be alternativel y configured as led outputs. these pins, gpio[7:0] (np1led[3:0] and np2led[3:0]), may be enabled to dr ive ethernet status leds for external indication of various attributes of the switch ports. gpio and led functionality is configured via the gpio/led system control and status registers (csrs), accessible through the i 2 c/spi serial interfaces or the mii/smi interfaces. these registers are defined in section 13.1.2, "gpio/led," on page 159 . 12.2 gpio operation the gpio controller is comprised of 12 programmable input/output pins. these pins are individually configurable via the gpio csrs. on application of a chip-level reset: ? all gpios are set as inputs (gpdir[11:0] cleared in general purpose i/o data & direction register (gpio_data_dir) ) ? all gpio interrupts are disabled (gpio[11:0]_int_en cleared in general purpose i/o interrupt status and enable regi ster (gpio_int_sts_en) ? all gpio interrupts are configured to low logi c level triggering (gpio_int_pol[11:0] cleared in general purpose i/o configuration register (gpio_cfg) ) note: gpio[7:0] may be configured as led outputs by default, dependant on the led_en_stap[7:0] configuration straps. refer to section 12.3, "led operation" for additional information. the direction and buffer type of all 12 gpios are configured via the general purpose i/o configuration register (gpio_cfg) and general purpose i/o data & direction register (gpio_data_dir) . the direction of each gpio, input or output, should be configured first via its respective gpio direction bit (gpdir[11:0]) in the general purpose i/o data & direction register (gpio_data_dir) . when configured as an output, the output buffer type for each gpio is selected by the gpiobuf[11:0] bits in the general purpose i/o configuration register (gpio_cfg) . push/pull and open-drain output buffers are supported for each gpio. when functioning as an open-drain driver, the gpio output pin is driven low when the corresponding data register bit (gpiod in the general purpose i/o data & direction register (gpio_data_dir) ) is cleared to 0, and is not driven when set to 1. when a gpio is enabled as an output, the value output to the gpio pin is set via the corresponding gpiod[11:0] bit in the general purpose i/o data & direction register (gpio_data_dir) . for gpios configured as inputs, the corresponding gpiod[11:0] bit reflects the current state of the gpio input. note: for gpio[9:8], the pin direction is a function of both the gpdir[9:8] bits of the general purpose i/o data & direction register (gpio_data_dir) and the 1588_gpio_oe[9:8] bits in the general purpose i/o configuration register (gpio_cfg) . downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 147 revision 2.0 (02-14-13) datasheet 12.2.1 gpio ieee 1588 timestamping two of the gpio pins, gpio[9:8], have the option to be used for ieee 1588 time stamp functions. this allows a time stamp capture to be triggered when the gpio is configured as an input, or output a signal from the gpio based on an ieee 1588 clock target compare event when conf igured as an output. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information on the ieee 1588 time stamping functions of the lan9313/lan9313i. 12.2.1.1 ieee 1588 gpio inputs when the gpio[9:8] pins are configured as input s, an active edge will capt ure the ieee 1588 clock into the high and low 1588 capture registers (1588_clock_hi_capture_gpio_x, and 1588_clock_lo_capture_gpio_x where x represents the number of the respective 1588 enabled gpio) and set the corresponding interrupt flags gpio[9:8]_int and 1588_gpio[9:8]_int in the general purpose i/o interrupt status and enable register (gpio_int_sts_en) and 1588 interrupt status and enable register (1588_int_sts_en) respectively. the gpio[9:8] inputs can also be configured to clear the clock target interrupt (1588_timer_int) in the 1588 interrupt status and enable register (1588_int_sts_en) by setting the corresponding gpio_1588_timer_int_clear_en[9:8] bit in the general purpose i/o configuration register (gpio_cfg) . gpio inputs must be active for greater than 40ns to be recognized as capture or interrupt clear events. 12.2.1.2 ieee 1588 gpio outputs the gpio[9:8] pins can be configured as ieee 1588 enabled outputs by setting the corresponding 1588_gpio_oe[9:8] bits in the general purpose i/o configuration register (gpio_cfg) . these bits override the gpdir[9:8] bits of the general purpose i/o data & dire ction register (gpio_data_dir) and allow for gpio output generation based on the ieee 1588 clock target compare event. clock target compare events occur when the value loaded into the 1588 clock target high-dword register (1588_clock_target_hi) and 1588 clock target low-dword register (1588_clock_target_lo) matches the current ieee 1588 clock value in the 1588 clock high- dword register (1588_clock_hi) and 1588 clock low-dword register (1588_clock_lo) . upon detection of a clock target compare event, gpio[9:8] can be configured to output a 100ns pulse, toggle its output, or reflect the 1588_timer_int bit in the 1588 interrupt status and enable register (1588_int_sts_en) by enabling the gpio_event_9 or gpio_event_8 bits of the 1588 configuration register (1588_config) . the clock event polarity, which determines whether the ieee 1588 gpio output is active high or active lo w, is controlled via the gpio_event_pol_9 and gpio_event_pol_8 bits of the general purpose i/o configuration register (gpio_cfg) . note: the 1588_gpio_oe[9:8] bits do not override the gpio buffer type bits gpiobuf[9:8] in the general purpose i/o configuration register (gpio_cfg) . 12.2.2 gpio interrupts each gpio of the lan9313/lan9313i provides the ability to trigger a unique gpio interrupt in the general purpose i/o interrupt status and enable register (gpio_int_sts_en) . reading the gpio_int[11:0] bits of this register provides the current status of the corresponding interrupt, and each interrupt is enabled by setting the corresponding gpio_int_en[11:0] bit. the gpio/led controller aggregates the enabled interrupt values into an internal signal which is sent to the system interrupt controller and is reflected via the interrupt status register (int_sts) bit 12 (gpio). for more information on the lan9313/lan9313i interrupts, refer to chapter 5, "system interrupts," on page 55 . 12.2.2.1 gpio interrupt polarity the interrupt polarity can be set for each individual gpio via the gpio_int_pol[11:0] bits in the general purpose i/o configuration register (gpio_cfg) . when set, a high logic level on the gpio pin will set the corresponding interrupt bit in the general purpose i/o interrupt status and enable register (gpio_int_sts_en) . when cleared, a low logic level on the gpio pin will set the corresponding interrupt bit. because gpio[9:8 ] have added i eee 1588 functi onality, the downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 148 smsc lan9313/lan9313i datasheet gpio_int_pol[9:8] bits also determine the polarity of the clock events as described in section 12.2.1.2 . 12.2.2.2 ieee 1588 gpio interrupts in addition to the standard gpio interrupts in the general purpose i/o interrupt status and enable register (gpi o_int_sts_en) , the ieee 1588 timestamp enabled gpio[9:8] pins contain the ability to generate and clear specific ieee 1588 related interrupt s. when gpio 9 or gpio 8 are enabled as inputs and an active edge occurs, the ieee 1588 clock capture is indicated by the 1588_gpio9_int and 1588_gpio8_int interrupts respectively in the 1588 interrupt status and enable register (1588_int_sts_en) . these interrupts are enabled by setting the corresponding 1588_gpio9_en and 1588_gpio8_en bits in the 1588 interrupt status and enable register (1588_int_sts_en) . gpio inputs must be active for greater than 40ns to be recognized as capture events. when gpio 8 and gpio 9 are enabled, the 1588 timer interrupt bit (1588_timer_int) of the 1588 interrupt status and enable register (1588_int_sts_en) can be cleared by an active edge on gpio[9:8]. a clear is only registered when the gpio input is active for greater than 40ns. 12.3 led operation eight pins, gpio[7:0], are shared with led function s (np1led[3:0] and np2led[3:0]). these pins are configured as led outputs by setting the corresponding led_en bit in the led configuration register (led_cfg) . when configured as a led, the pin is an open-drain, active-low output and the gpio related input buffer and pull-up are disabled. the led outputs are always active low. as a result, a low signal on the led pin equates to the led on, and a high signal equates to the led off. the functions associated with each led pin are configurable via the led_fun[1:0] bits of the led configuration register (led_cfg) . these bits allow the configuration of each led pin to indicate various port related functions. these functions are described in table 12.1 followed by a detailed definition of each indication type. the default values of the led_fun[1:0] and led_en[7:0] bits of the led configuration register (led_cfg) are determined by the led_fun_strap[1:0] and led_en_strap[7:0] configuration straps. for more information on the led configuration register (led_cfg) and its related straps, refer to section 13.1.2.4, "led configuration register (led_cfg)," on page 163 . table 12.1 led operation as a function of led_cfg[9:8] led_cfg[9:8] (led_fun[1:0]) 00b 01b 10b 11b np2led3 (gpio7) rx port 0 rx port 0 activity port 2 - np2led2 (gpio6) link / activity port 2 100link / activity port 2 link port 2 - np2led1 (gpio5) full-duplex / collision port 2 full-duplex / collision port 2 full-duplex / collision port 2 txen port 2 np2led0 (gpio4) speed port 2 10link / activity port 2 speed port 2 rxdv port 2 np1led3 (gpio3) tx port 0 tx port 0 activity port 1 txen port 0 np1led2 (gpio2) link / activity port 1 100link / activity port 1 link port 1 rxdv port 0 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 149 revision 2.0 (02-14-13) datasheet the various led indication functions shown in table 12.1 are described below: ? tx port 0 - the signal is pulsed low for 80ms to indica te activity from the switch fabric to the external mii pins. this signal is then driven high for a minimum of 80ms, after which the process will repeat if tx activity is again detected. ? rx port 0 - the signal is pulsed low for 80ms to indicate activity from the external mii pins to the switch fabric. this signal is then driven high for a minimum of 80ms, after which the process will repeat if rx activity is again detected. ? link / activity - a steady low output indicates that the port has a valid link, while a steady high indicates no link on the port. the signal is pulsed high for 80ms to indicate transmit or receive activity on the port. the signal is then driven low for a minimum of 80ms, after which the process will repeat if rx or tx activity is again detected. ? full-duplex / collision - a steady low output indicates the port is in full-duplex mode, while a steady high indicates no link on the port. in half-duplex mode, the signal is pulsed low for 80ms to indicate a network collision. the signal is then driven high for a minimum of 80ms, after which the process will repeat if another collision is detected. ? speed - a steady low output indicates the selected speed is 100mbps. a steady high output indicates the selected speed is 10mbps. the signal will be held high if the port does not have a valid link. ? 100link / activity - a steady low output indicates the port has a valid link and the speed is 100mbps. the signal is pulsed high for 80ms to indi cate tx or rx activity on the port. the signal is then driven low for a minimum of 80ms, after which the process will repeat if rx or tx a ctivity is again detected. the signal will be held high if the port does not have a valid link. ? 10link / activity - a steady low output indicates the port has a valid link and the speed is 10mbps. the signal is pulsed high for 80ms to indicate tr ansmit or receive activity on the port. the signal is then driven low for a minimum of 80ms, after which the process will repeat if rx or tx a ctivity is again detected. this signal will be held high if the port does not have a valid link. ? activity - the signal is pulsed low for 80ms to indicate transmit or receive activity. the signal is then driven high for a minimum of 80ms, after which the process will repeat if rx or tx activity is again detected. the signal will be held high if the port does not have a valid link. ? link - a steady low indicates the port has a valid link. ? txen port 0 - non-stretched txen signal from the switch fabric to the external mii pins. ? rxdv port 0 - non-stretched rxdv signal from the external mii pins to the switch fabric. ? txen - non-stretched txen signal from the switch fabric to the phy. ? rxdv - non-stretched rxdv signal from the phy to the switch fabric. np1led1 (gpio1) full-duplex / collision port 1 full-duplex / collision port 1 full-duplex / collision port 1 txen port 1 np1led0 (gpio0) speed port 1 10link / activity port 1 speed port 1 rxdv port 1 table 12.1 led operation as a func tion of led_cfg[9:8] (continued) led_cfg[9:8] (led_fun[1:0]) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 150 smsc lan9313/lan9313i datasheet chapter 13 register descriptions this section describes the various lan9313/lan9313i control and status registers (csrs). these registers are broken into 3 categories. the following sections detail the functionality and accessibility of all the lan9313/lan9313i registers within each category: ? section 13.1, "system control and status registers," on page 151 ? section 13.2, "ethernet phy control and status registers," on page 235 ? section 13.3, "switch fabric control and status registers," on page 257 figure 13.1 contains an overall base register memory map of the lan9313/lan9313i. this memory map is not drawn to scale, and should be used for general reference only. note: register bit type definitions are provided in section 1.3, "register nomenclature," on page 18 . note: not all lan9313/lan9313i registers are memory mapped or directly addressable. for details on the accessibility of the various lan9313/lan9313i registers, refer the register sub-sections listed above. figure 13.1 lan9313/lan9313i base register memory map base + 000h 04ch 100h reserved 2e0h ... 2dch 3ffh switch csr direct data registers 200h ... 050h 1588 registers virtual phy registers 1c0h 1dch 19ch switch interface registers 1ach 1b0h phy management interface registers 0a4h 0a8h reserved system csrs downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 151 revision 2.0 (02-14-13) datasheet 13.1 system contro l and status registers the system csrs are directly addressable memo ry mapped registers with a base address offset range of 050h to 2dch. these regi sters are accessed through the i 2 c/spi serial interfaces or the miim/smi serial interface. for more information on the various lan9313/lan9313i modes and their corresponding address configurations, see section 2.3, "modes of operation," on page 24 . ta b l e 1 3 . 1 lists the system csrs and their correspondi ng addresses in order. all system csrs are reset to their default value on the assertion of a chip-level reset. the system csrs can be divided into 8 sub-categories. each of these sub-categories contains the system csr descriptions of the associated registers. the regist er descriptions are categorized as follows: ? section 13.1.1, "interrupts," on page 155 ? section 13.1.2, "gpio/led," on page 159 ? section 13.1.3, "eeprom," on page 164 ? section 13.1.4, "ieee 1588," on page 168 ? section 13.1.5, "switch fabric," on page 196 ? section 13.1.6, "phy management interface (pmi)," on page 211 ? section 13.1.7, "virtual phy," on page 213 ? section 13.1.8, "miscellaneous," on page 228 table 13.1 system control and status registers address offset symbol register name 000h - 04ch reserved reserved for future use 050h id_rev chip id and revision register, section 13.1.8.1 054h irq_cfg interrupt configuration register, section 13.1.1.1 058h int_sts interrupt status register, section 13.1.1.2 05ch int_en interrupt enable register, section 13.1.1.3 060h reserved reserved for future use 064h byte_test byte order test register, section 13.1.8.2 068h - 070h reserved reserved for future use 074h hw_cfg hardware configuration register, section 13.1.8.3 078h - 088h reserved reserved for future use 08ch gpt_cfg general purpose timer configuration register, section 13.1.8.4 090h gpt_cnt general purpose timer count register, section 13.1.8.5 094h - 098h reserved reserved for future use 09ch free_run free running counter register, section 13.1.8.6 0a0h reserved reserved for future use 0a4h pmi_data phy management interface data register, section 13.1.6.1 0a8h pmi_access phy management interface access register, section 13.1.6.2 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 152 smsc lan9313/lan9313i datasheet 0ach - 0fch reserved reserved for future use 100h 1588_clock_hi_rx_capture_1 port 1 1588 clock high-dword receive capture register, section 13.1.4.1 104h 1588_clock_lo_rx_capture_1 port 1 1588 clock low-dword receive capture register, section 13.1.4.2 108h 1588_seq_id_src_uuid_hi_rx_capture_1 port 1 1588 sequence id, source uuid high-word receive capture register, section 13.1.4.3 10ch 1588_src_uuid_lo_rx_capture_1 port 1 1588 source uuid low-dword receive capture register, section 13.1.4.4 110h 1588_clock_hi_tx_capture_1 port 1 1588 clock high-dword transmit capture register, section 13.1.4.5 114h 1588_clock_lo_tx_capture_1 port 1 1588 clock low-dword transmit capture register, section 13.1.4.6 118h 1588_seq_id_src_uuid_hi_tx_capture_1 port 1 1588 sequence id, source uuid high-word transmit capture register, section 13.1.4.7 11c 1588_src_uuid_lo_tx_capture_1 port 1 1588 source uuid low-dword transmit capture register, section 13.1.4.8 120h 1588_clock_hi_rx_capture_2 port 2 1588 clock high-dword receive capture register, section 13.1.4.1 124h 1588_clock_lo_rx_capture_2 port 2 1588 clock low-dword receive capture register, section 13.1.4.2 128h 1588_seq_id_src_uuid_hi_rx_capture_2 port 2 1588 sequence id, source uuid high-word receive capture register, section 13.1.4.3 12ch 1588_src_uuid_lo_rx_capture_2 port 2 1588 source uuid low-dword receive capture register, section 13.1.4.4 130h 1588_clock_hi_tx_capture_2 port 2 1588 clock high-dword transmit capture register, section 13.1.4.5 134h 1588_clock_lo_tx_capture_2 port 2 1588 clock low-dword transmit capture register, section 13.1.4.6 138h 1588_seq_id_src_uuid_hi_tx_capture_2 port 2 1588 sequence id, source uuid high-word transmit capture register, section 13.1.4.7 13ch 1588_src_uuid_lo_tx_capture_2 port 2 1588 source uuid low-dword transmit capture register, section 13.1.4.8 140h 1588_clock_hi_rx_capture_mii port 0 1588 clock high-dword receive capture register, section 13.1.4.1 144h 1588_clock_lo_rx_capture_mii port 0 1588 clock low-dword receive capture register, section 13.1.4.2 148h 1588_seq_id_src_uuid_hi_rx_capture_mii port 0 1588 sequence id, source uuid high-word receive capture register, section 13.1.4.3 14ch 1588_src_uuid_lo_rx_capture_mii port 0 1588 source uuid low-dword receive capture register, section 13.1.4.4 150h 1588_clock_hi_tx_capture_mii port 0 1588 clock high-dword transmit capture register, section 13.1.4.5 154h 1588_clock_lo_tx_capture_mii port 0 1588 clock low-dword transmit capture register, section 13.1.4.6 table 13.1 system control and status registers (continued) address offset symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 153 revision 2.0 (02-14-13) datasheet 158h 1588_seq_id_src_uuid_hi_tx_capture_mii port 0 1588 sequence id, source uuid high-word transmit capture register, section 13.1.4.7 15ch 1588_src_uuid_lo_tx_capture_mii port 0 1588 source uuid low-dword transmit capture register, section 13.1.4.8 160h 1588_clock_hi_capture_gpio_8 gpio 8 1588 clock high-dword capture register, section 13.1.4.9 164h 1588_clock_lo_capture_gpio_8 gpio 8 1588 clock low-dword capture register, section 13.1.4.10 168h 1588_clock_hi_capture_gpio_9 gpio 9 1588 clock high-dword capture register, section 13.1.4.11 16ch 1588_clock_lo_capture_gpio_9 gpio 9 1588 clock low-dword capture register, section 13.1.4.12 170h 1588_clock_hi 1588 clock high-dword register, section 13.1.4.13 174h 1588_clock_lo 1588 clock low-dword register, section 13.1.4.14 178h 1588_clock_addend 1588 clock addend register, section 13.1.4.15 17ch 1588_clock_target_hi 1588 clock target high-dword register, section 13.1.4.16 180h 1588_clock_target_lo 1588 clock target low-dword register, section 13.1.4.17 184h 1588_clock_target_reload_hi 1588 clock target reload high-dword register, section 13.1.4.18 188h 1588_clock_target_reload_lo 1588 clock target reload/add low-dword register, section 13.1.4.19 18ch 1588_aux_mac_hi 1588 auxiliary mac address high-word register, section 13.1.4.20 190h 1588_aux_mac_lo 1588 auxiliary mac addres s low-dword register, section 13.1.4.21 194h 1588_config 1588 configuration register, section 13.1.4.22 198h 1588_int_sts_en 1588 interrupt status enable register, section 13.1.4.23 19ch 1588_cmd 1588 command register, section 13.1.4.24 1a0h manual_fc_1 port 1 manual flow control register, section 13.1.5.1 1a4h manual_fc_2 port 2 manual flow control register, section 13.1.5.2 1a8h manual_fc_mii port 0 flow control register, section 13.1.5.3 1ach switch_csr_data switch fabric csr interface data register, section 13.1.5.4 1b0h switch_csr_cmd switch fabric csr interface command register, section 13.1.5.5 1b4h e2p_cmd eeprom command register, section 13.1.3.1 1b8h e2p_data eeprom data register, section 13.1.3.2 1bch led_cfg led configuration register, section 13.1.2.4 1c0h vphy_basic_ctrl virtual phy basic control register, section 13.1.7.1 table 13.1 system control and status registers (continued) address offset symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 154 smsc lan9313/lan9313i datasheet 1c4h vphy_basic_status virtual phy basic status register, section 13.1.7.2 1c8h vphy_id_msb virtual phy identification msb register, section 13.1.7.3 1cch vphy_id_lsb virtual phy identification lsb register, section 13.1.7.4 1d0h vphy_an_adv virtual phy auto-negotiation advertisement register, section 13.1.7.5 1d4h vphy_an_lp_base_ability virtual phy auto-negotiation link partner base page ability register, section 13.1.7.6 1d8h vphy_an_exp virtual phy auto-negotiation expansion register, section 13.1.7.7 1dch vphy_special_control_status virtual phy special control/status register, section 13.1.7.8 1e0h gpio_cfg general purpose i/o configuration register, section 13.1.2.1 1e4h gpio_data_dir general purpose i/o data & direction register, section 13.1.2.2 1e8h gpio_int_sts_en general purpose i/o interrupt status and enable register, section 13.1.2.3 1ech reserved reserved for future use 1f0h switch_mac_addrh switch mac address high register, section 13.1.5.6 1f4h switch_mac_addrl switch mac address low register, section 13.1.5.7 1f8h reset_ctl reset control register, section 13.1.8.7 1fch reserved reserved for future use 200h-2dch switch_csr_direct_data switch engine csr interface direct data register, section 13.1.5.8 2e0h-3ffh reserved reserved for future use table 13.1 system control and status registers (continued) address offset symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 155 revision 2.0 (02-14-13) datasheet 13.1.1 interrupts this section details the interrupt related system csrs. these registers control, configure, and monitor the irq interrupt output pin and the various lan9313/lan9313i interrupt sources. for more information on the lan9313/lan9313i interrupts, refer to chapter 5, "system interrupts," on page 55 . 13.1.1.1 interrupt configur ation register (irq_cfg) this read/write register configures and indicates the state of the irq signal. offset: 054h size: 32 bits bits description type default 31:24 interrupt de-assertion interval (int_deas) this field determines the interrupt request de-assertion interval in multiples of 10 microseconds. setting this field to zero causes the device to disable the int_deas interval, reset the interval counter and issue any pending interrupts. if a new, non- zero value is written to this field, any subsequent interrupts will obey the new setting. r/w 00h 23:15 reserved ro - 14 interrupt de-assertion interval clear (int_deas_clr) writing a 1 to this register clears the de-assertion counter in the interrupt controller, thus causing a new de-assertion interval to begin (regardless of whether or not the interrupt controller is currently in an active de-assertion interval). 0: normal operation 1: clear de-assertion counter r/w sc 0h 13 interrupt de-assertion status (int_deas_sts) when set, this bit indicates that interrupts are currently in a de-assertion interval, and will not be sent to the irq pin. when this bit is clear, interrupts are not currently in a de-assertion interval, and will be sent to the irq pin. 0: no interrupts in de-assertion interval 1: interrupts in de-assertion interval ro sc 0b 12 master interrupt (irq_int) this read-only bit indicates the state of the internal irq line, regardless of the setting of the irq_en bit, or the state of the interrupt de-assertion function. when this bit is set, one of the enabled interrupts is currently active. 0: no enabled interrupts active 1: one or more enabled interrupts active ro 0b 11:9 reserved ro - 8 irq enable (irq_en) this bit controls the final interrupt output to the irq pin. when clear, the irq output is disabled and permanently de-asserted. this bit has no effect on any internal interrupt status bits. 0: disable output on irq pin 1: enable output on irq pin r/w 0b 7:5 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 156 smsc lan9313/lan9313i datasheet note 13.1 register bits designated as nasr are not reset when the digital_rst bit in the reset control register (reset_ctl) is set. 4 irq polarity (irq_pol) when cleared, this bit enables the irq line to function as an active low output. when set, the irq output is active high. when the irq is configured as an open-drain output (via the irq_type bit), this bit is ignored, and the interrupt is always active low. 0: irq active low output 1: irq active high output r/w nasr note 13.1 0b 3:1 reserved ro - 0 irq buffer type (irq_type) when this bit is cleared, the irq pin functions as an open-drain output for use in a wired-or interrupt configuration. when set, the irq is a push-pull driver. note: when configured as an open-drain output, the irq_pol bit is ignored and the interrupt output is always active low. 0: irq pin open-drain output 1: irq pin push-pull driver r/w nasr note 13.1 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 157 revision 2.0 (02-14-13) datasheet 13.1.1.2 interrupt status register (int_sts) this register contains the current status of the generated interrupts. a value of 1 indicates the corresponding interrupt conditions have been met, while a value of 0 indicates the interrupt conditions have not been met. the bits of this register reflect the status of the interrupt source regardless of whether the source has been enabled as an interrupt in the interrupt enable register (int_en) . where indicated as r/wc, writing a 1 to the corresponding bits acknowledges and clears the interrupt. offset: 058h size: 32 bits bits description type default 31 software interrupt (sw_int) this interrupt is generated when the sw_int_en bit of the interrupt enable register (int_en) is set high. writing a one clears this interrupt. r/wc 0b 30 device ready (ready) this interrupt indicates that the lan9313/lan9313i is ready to be accessed after a power-up or reset condition. r/wc 0b 29 1588 interrupt event (1588_evnt) this bit indicates an interrupt event from the ieee 1588 module. this bit should be used in conjunction with the 1588 interrupt status and enable register (1588_int_sts_en) to determine the source of the interrupt event within the 1588 module. ro 0b 28 switch fabric interrupt event (switch_int) this bit indicates an interrupt event from the switch fabric. this bit should be used in conjunction with the switch global interrupt pending register (sw_ipr) to determine the source of the interrupt event within the switch fabric. ro 0b 27 port 2 phy interrupt event (phy_int2) this bit indicates an interrupt event from the port 2 phy. the source of the interrupt can be determined by polling the port x phy interrupt source flags register (phy_interrupt_source_x) . ro 0b 26 port 1 phy interrupt event (phy_int1) this bit indicates an interrupt event from the port 1 phy. the source of the interrupt can be determined by polling the port x phy interrupt source flags register (phy_interrupt_source_x) . ro 0b 25:20 reserved ro - 19 gp timer (gpt_int) this interrupt is issued when the general purpose timer count register (gpt_cnt) wraps past zero to ffffh. r/wc 0b 18:13 reserved ro - 12 gpio interrupt event (gpio) this bit indicates an interrupt event from the general purpose i/o. the source of the interrupt can be determined by polling the general purpose i/o interrupt status and enable register (gpio_int_sts_en) ro 0b 11:0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 158 smsc lan9313/lan9313i datasheet 13.1.1.3 interrupt enable register (int_en) this register contains the interrupt enables for the irq output pin. writing 1 to any of the bits enables the corresponding interrupt as a source for irq. bits in the interrupt status register (int_sts) register will still reflect the status of the interrupt source regardless of whether the source is enabled as an interrupt in this register (with the exception of sw _int_en). for descriptions of each interrupt, refer to the interrupt status register (int_sts) bits, which mimic the layout of this register. offset: 05ch size: 32 bits bits description type default 31 software interrupt enable (sw_int_en) r/w 0b 30 device ready enable (ready_en) r/w 0b 29 1588 interrupt event en able (1588_evnt_en) r/w 0b 28 switch engine interrupt event enable (switch_int_en) r/w 0b 27 port 2 phy interrupt even t enable (phy_int2_en) r/w 0b 26 port 1 phy interrupt even t enable (phy_int1_en) r/w 0b 25:20 reserved ro - 19 gp timer interrupt enable (gpt_int_en) r/w 0b 18:13 reserved ro - 12 gpio interrupt even t enable (gpio_en) r/w 0b 11:0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 159 revision 2.0 (02-14-13) datasheet 13.1.2 gpio/led this section details the general purpose i/o (gpio) and led related system csrs. 13.1.2.1 general purpose i/o conf iguration regist er (gpio_cfg) this read/write register configures the gpio input and output pins. the polarity of the 12 gpio pins is configured here as well as the ieee 1588 timestamping and clo ck compare event output properties of the gpio[9:8] pins. offset: 1e0h size: 32 bits bits description type default 31:30 reserved ro - 29:28 gpio 1588 timer interrupt clear enable 9-8 (gpio_1588_timer_int_clear_en[9:8]) these bits enable inputs on gpio9 and gpio8 to clear the 1588_timer_int bit of the 1588 interrupt status and enable register (1588_int_sts_en) . the polarity of these inputs is determined by gpio_int_pol[9:8]. note: the gpio must be configured as an input for this function to operate. for the clear function, gpio inputs are edge sensitive and must be active for greater than 40 ns to be recognized. r/w 00b 27:16 gpio interrupt polarity 11-0 (gpio_int_pol[11:0]) these bits set the interrupt polarity of the 12 gpio pins. the configured level (high/low) will set the corre sponding gpio_int bit in the general purpose i/o interrupt status and en able register (g pio_int_sts_en) . 0: sets low logic level trigge r on corresponding gpio pin 1: sets high logic level trig ger on corresponding gpio pin gpio_int_pol[9:8] also determines the polarity of the gpio ieee 1588 time clock capture events and the gpio 1588 timer interrupt clear inputs. refer to section 12.2, "gpio operation," on page 146 for additional information. r/w 0h 15:14 1588 gpio output enable 9-8 (1588_gpio_oe[9:8]) these bits configure gpio 9 and gpio 8 to output 1588 clock compare events. 0: disables the output of 1588 clock compare events 1: enables the output of 1588 clock compare events note: these bits override the direction bits in the general purpose i/o data & direction register (gpio_data_dir) register. however, the gpio buffer type (gpiobuf[11:0]) in the general purpose i/o configuration register (gpio_cfg) is not overridden. r/w 0h 13 gpio 9 clock event pola rity (gpio_ event_pol_9) this bit determines if the 1588 clock event output on gpio 9 is active high or low. 0: 1588 clock event output active low 1: 1588 clock event output active high r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 160 smsc lan9313/lan9313i datasheet 12 gpio 8 clock event pola rity (gpio_ event_pol_8) this bit determines if the 1588 clock event output on gpio 8 is active high or low. 0: 1588 clock event output active low 1: 1588 clock event output active high r/w 1b 11:0 gpio buffer type 11-0 (gpiobuf[11:0]) this field sets the buffer types of the 12 gpio pins. 0: corresponding gpio pin configured as an open-drain driver 1: corresponding gpio pin configured as a push/pull driver as an open-drain driver, the output pi n is driven low when the corresponding data register is cleared, and is not driven when the corresponding data register is set. as an open-drain driver used for 1588 clock events, the corresponding gpio_event_pol_8 and gp io_event_pol_9 bits determine when the corresponding pin is driven per the following table: r/w 0h bits description type default gpiox clock event polarity 1588 clock event pin state 0 no not driven 0 yes driven low 1 no driven low 1 yes not driven downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 161 revision 2.0 (02-14-13) datasheet 13.1.2.2 general purpose i/o data & direction register (gpio_data_dir) this read/write register configures the direction of the 12 gpio pins and contains the gpio input and output data bits. offset: 1e4h size: 32 bits bits description type default 31:28 reserved ro - 27:16 gpio direction 11-0 (gpiodir[11:0]) these bits set the input/output direction of the 12 gpio pins. 0: gpio pin is configured as an input 1: gpio pin is configured as an output r/w 0h 15:12 reserved ro - 11:0 gpio data 11-0 (gpiod[11:0]) when a gpio pin is enabled as an output, the value written to this field is output on the corresponding gpio pin. upon a read, the value returned depends on the current direction of the pin. if the pin is an input, the data reflects the current state of the corresponding gpio pin. if the pin is an output, the data is the value that was last written into this register. for gpios 11-10 and 7-0, the pin direction is determined by the gpdir bits of this register. for gpios 9 and 8, the pin direction is determined by the gpdir bits and the 1588_gpio_oe bits in the general purpose i/o configuration register (gpio_cfg) . r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 162 smsc lan9313/lan9313i datasheet 13.1.2.3 general purpose i/o interrupt status and enable register (gpio_int_sts_en) this read/write register contains the gpio interrupt status bits. writing a 1 to any of the interrupt status bits acknowledges and clears the interrupt. if enabled, these interrupt bits are cascaded into bit 12 (gpio) of the interrupt status register (int_sts) . writing a 1 to any of the interrupt enable bits will enable the corresponding interrupt as a source. status bits will still reflect the status of the interrupt source regardless of whether the source is enabled as an interrupt in this register. bit 12 (gpio_en) of the interrupt enable register (int_en) must also be set in order for an actual system level interrupt to occur. refer to chapter 5, "system interrupts," on page 55 for additional information. offset: 1e8h size: 32 bits bits description type default 31:28 reserved ro - 27:16 gpio interrupt enable[11: 0] (gpio[11:0]_int_en) when set, these bits enable the corresponding gpio interrupt. note: the gpio interrupts must also be enabled via bit 12 (gpio_en) of the interrupt enable register (int_en) in order to cause the interrupt pin (irq) to be asserted. r/w 0h 15:12 reserved ro - 11:0 gpio interrupt[11:0] (gpio[11:0]_int) these signals reflect the interrupt status as generated by the gpios. these interrupts are configured through the general purpose i/o configuration register (gpio_cfg) . note: as gpio interrupts, gpio inputs are level sensitive and must be active greater than 40 ns to be recognized as interrupt inputs. r/wc 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 163 revision 2.0 (02-14-13) datasheet 13.1.2.4 led configuration register (led_cfg) this read/write register configures the gpio[7:0] pins as led[7:0] pins and sets their functionality. note 13.2 the default value of this field is determined by the configuration strap led_fun_strap[1:0]. configuration strap values are latched on power-on reset or nrst de-assertion. some configuration straps can be overridden by values from the eeprom loader. refer to section 4.2.4, "configuration straps," on page 47 for more information. note 13.3 the default value of this field is determined by the configuration strap led_en_strap[7:0]. configuration strap values are latched on power-on reset or nrst de-assertion. some configuration straps can be overridden by values from the eeprom loader. refer to section 4.2.4, "configuration straps," on page 47 for more information. offset: 1bch size: 32 bits bits description type default 31:10 reserved ro - 9:8 led function 1-0 (led_fun[1:0]) these bits control the function associated with each led pin as shown in table 12.1 of section 12.3, "led operation," on page 148 . note: in order for these assignments to be valid, the particular pin must be enabled as an led output pin via the led_en[7:0] bits of this register. r/w note 13.2 7:0 led enable 7-0 (led_en[7:0]) this field toggles the functionality of the gpio[7:0] pins between gpio and led. 0: enables the associated pin as a gpio signal 1: enables the associated pin as a led output r/w note 13.3 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 164 smsc lan9313/lan9313i datasheet 13.1.3 eeprom this section details the eeprom re lated system csrs. these registers should only be used if an eeprom has been connected to the la n9313/lan9313i. re fer to chapter section 8.2, "i2c/microwire master eeprom controller," on page 105 for additional information on the various modes (i 2 c and microwire) of the eepr om controller (epc). 13.1.3.1 eeprom command register (e2p_cmd) this read/write register is used to control the read and write operations of the serial eeprom. offset: 1b4h size: 32 bits bits description type default 31 eeprom controller busy (epc_busy) when a 1 is written into this bit, the operation specified in the epc_command field of this register is performed at the specified eeprom address. this bit will remain set until th e selected operation is complete. in the case of a read, this indicates that the ho st can read valid data from the eeprom data register (e2p_data) . the e2p_cmd and e2p_data registers should not be modified until this bit is cleared. in the case where a write is attempted and an eeprom is not present, the epc_busy bit remains set until the eeprom controller timeout (epc_timeout) bit is set. at this time the epc_busy bit is cleared. note: epc_busy is set immediately following power-up, or pin reset, or digital_rst reset. after the eeprom loader has finished loading, the epc_busy bit is cleared. refer to chapter section 8.2.4, "eeprom loader," on page 117 for more information. r/w sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 165 revision 2.0 (02-14-13) datasheet 30:28 eeprom controller command (epc_command) this field is used to issue comm ands to the eeprom controller. the eeprom controller will execute a command when the epc_busy bit is set. a new command must not be issued unti l the previous command completes. the field is encoded as follows: note: only the read, write and reload commands are valid for i 2 c mode. if an unsupported command is attempted, the epc_busy bit will be cleared and epc_timeout will be set. the eeprom operations are defined as follows: read (read location) this command will cause a read of the eeprom location pointed to by the epc_address bit field. the result of the read is available in the eeprom data register (e2p_data) . ewds (erase/write disable) (microwire mode only) - when this command is issued, the eeprom will ignore erase and write commands. to re-enable erase/ writes operations, issue the ewen command. ewen (erase/write enable) (microwire mode only) - enables the eeprom for erase and write operations. the eeprom will allow erase and write operations until the ewds command is sent, or until the power is cycled. the microw ire eeprom device will power-up in the erase/write disabled state. any erase or write operations will fail until an ewen command is issued. write (write location) if erase/write operations are enabled in the eeprom, this command will cause the contents of the eeprom data register (e2p_data) to be written to the eeprom location selected by the epc_address field. for microwire, er ase/write operations must be enabled in the eeprom. wral (write all) (microwire mode only) - if erase/write operations ar e enabled in the eeprom, this command will cause the contents of the eeprom data register (e2p_data) to be written to every eeprom memory location. erase (erase location) (microwire mode only) - if erase/write operations ar e enabled in the eeprom, this command will erase the location se lected by the epc_address field. eral (erase all) (microwire mode only) - if erase/write operations ar e enabled in the eeprom, this command will initiate a bulk erase of the entire eeprom. reload (eeprom lo ader reload) instructs the eeprom loader to reload the device from the eeprom. if a value of a5h is not found in the first address of the eeprom, the eeprom is assumed to be un-programmed and the reload operation will fail. the cfg_loaded bit indicates a successful load. following this command, the device will enter the not ready state. the ready bit in the hardware configuration register (hw_cfg) should be polled to determine then the reload is complete. r/w 000b 27:19 reserved ro - bits description type default [30] [29] [28] operation 000 r e a d 001 e w d s 0 1 0 ewen 011 w r i t e 100 w r a l 1 0 1 erase 1 1 0 eral 111 r e l o a d downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 166 smsc lan9313/lan9313i datasheet 18 eeprom loader address over flow (loader_overflow) this bit indicates that the eeprom load er tried to read pa st the end of the eeprom address space. this indi cates misconfigured eeprom data. this bit is cleared when the eeprom loader is restarted with a reload command, or a digital reset(digital_rst). ro 0b 17 eeprom controller ti meout (epc_timeout) this bit is set when a timeout occurs, indicating the last operation was unsuccessful. if an eeprom erase, er al, write or wral operation is performed and no response is received from the eeprom within 30ms, the eeprom controller will timeout an d return to its idle state. for the i 2 c mode, the bit is also set if the eeprom fails to respond with the appropriate acks, if the eeprom slave device holds the clock low for more than 30ms, or if an unsupported epc_command is attempted. this bit is cleared when written high. note: when in microwire m ode, if an eeprom devic e is not connected, an internal pull-down on the eedi pin will keep the eedi signal low and allow timeouts to occur. if eedi is pulled high externally, epc commands will not time out if an eeprom device is not connected. in this case the epc_busy bit will be cleared as soon as the command sequence is complete. it should also be noted that the erase, eral, write and wral commands are the only epc commands that will timeout if an eeprom device is not present and the eedi signal is pulled low. r/wc 0b 16 configuration loaded (cfg_loaded) when set, this bit indi cates that a valid eepr om was found and the eeprom loader completed norm ally. this bit is set upon a successful load. it is cleared on power-up, pin and digital_rst resets, or at the start of a reload. this bit is cleared when written high. r/wc 0b 15:0 eeprom controller address (epc_address) this field is used by the eeprom controller to address a specific memory location in the serial eeprom. this address must be byte aligned. r/w 0000h bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 167 revision 2.0 (02-14-13) datasheet 13.1.3.2 eeprom data register (e2p_data) this read/write register is used in conjunction with the eeprom command register (e2p_cmd) to perform read and write operations with the serial eeprom. offset: 1b8h size: 32 bits bits description type default 31:8 reserved ro - 7:0 eeprom data (eeprom_data) this field contains the data read from or written to the eeprom. r/w 00h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 168 smsc lan9313/lan9313i datasheet 13.1.4 ieee 1588 this section details the ieee 1588 timestamp relat ed registers. each port of the lan9313/lan9313i has a 1588 timestamp block with 8 related registers, 4 for transmit capture and 4 for receive capture. these sets of registers are identical in functionality for each port, and thus their register descriptions have been consolidated. in these cases, the register names will be amended with a lowercase x in place of the port designation. the wildcard x should be replaced with 1, 2, or mii for the port 1, port 2, and port 0(external mii) respectively. a list of all the 1588 related registers can be seen in ta b l e 1 3 . 1 . for more information on the ieee 1588, refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 . 13.1.4.1 port x 1588 clock high-dword receive capture register (1588_clock_hi_rx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 100h size: 32 bits port 2: 120hport 0: 140h bits description type default 31:0 timestamp high (ts_hi) this field contains the high 32-bits of the timestamp taken on the receipt of a 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 169 revision 2.0 (02-14-13) datasheet 13.1.4.2 port x 1588 clock low-dword receive ca pture register (1588_clock_lo_rx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 104h size: 32 bits port 2: 124hport 0: 144h bits description type default 31:0 timestamp low (ts_lo) this field contains the low 32-bits of the timestamp taken on the receipt of a 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 170 smsc lan9313/lan9313i datasheet 13.1.4.3 port x 1588 sequence id, source uuid high-word receive capture register (1588_seq_id_src_uuid_hi_rx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 108h size: 32 bits port 2: 128hport 0: 148h bits description type default 31:16 sequence id (seq_id) this field contains the sequence id from the 1588 sync or delay_req packet. ro 0000h 15:0 source uuid high (src_uuid_hi) this field contains the high 16-bits of the source uuid from the 1588 sync or delay_req packet. ro 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 171 revision 2.0 (02-14-13) datasheet 13.1.4.4 port x 1588 source uuid low-dword receive capture register (1588_src_uuid_lo_rx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 10ch size: 32 bits port 2: 12chport 0: 14ch bits description type default 31:0 source uuid low (src_uuid_lo) this field contains the low 32-bits of the source uuid from the 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 172 smsc lan9313/lan9313i datasheet 13.1.4.5 port x 1588 clock high-dword transmit capture register (1588_clock_hi_tx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 110h size: 32 bits port 2: 130hport 0: 150h bits description type default 31:0 timestamp high (ts_hi) this field contains the high 32-bits of the timestamp taken on the transmission of a 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 173 revision 2.0 (02-14-13) datasheet 13.1.4.6 port x 1588 clock low- dword transmit capture regist er (1588_clock_lo_tx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 114h size: 32 bits port 2: 134hport 0: 154h bits description type default 31:0 timestamp low (ts_lo) this field contains the low 32-bits of the timestamp taken on the transmission of a 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 174 smsc lan9313/lan9313i datasheet 13.1.4.7 port x 1588 sequence id, source uuid high-word transmit capture register (1588_seq_id_src_uuid_hi_tx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 118h size: 32 bits port 2: 138hport 0: 158h bits description type default 31:16 sequence id (seq_id) this field contains the sequence id from the 1588 sync or delay_req packet. ro 0000h 15:0 source uuid high (src_uuid_hi) this field contains the high 16-bits of the source uuid from the 1588 sync or delay_req packet. ro 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 175 revision 2.0 (02-14-13) datasheet 13.1.4.8 port x 1588 source uuid low-dword transmit capture register (1588_src_uuid_lo_tx_capture_x) note: the selection between sync or delay_req packets is based on the corresponding master/slave bit in the 1588 configuration register (1588_config) . note: there are multiple instantiations of this register, one for each port of the lan9313/lan9313i. refer to section 13.1.4 for additional information. note: for port 0(external mii), receive is defined as data from the switch fabric, while transmit is to the switch fabric. offset: port 1: 11ch size: 32 bits port 2: 13chport 0: 15ch bits description type default 31:0 source uuid low (src_uuid_tx_lo) this field contains the low 32-bits of the source uuid from the 1588 sync or delay_req packet. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 176 smsc lan9313/lan9313i datasheet 13.1.4.9 gpio 8 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_8) this read only register combined with the gpio 8 1588 clock low-dword capture register (1588_clock_lo_capture_gpio_8) form the 64-bit gpio 8 timestamp capture. offset: 160h size: 32 bits bits description type default 31:0 timestamp high (ts_hi) this field contains the high 32-bits of the timestamp upon activation of gpio 8. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 177 revision 2.0 (02-14-13) datasheet 13.1.4.10 gpio 8 1588 clock low-dword captur e register (1588_clock_lo_capture_gpio_8) this read only register combined with the gpio 8 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_8) form the 64-bit gpio 8 timestamp capture. offset: 164h size: 32 bits bits description type default 31:0 timestamp low (ts_lo) this field contains the low 32-bits of the timestamp upon activation of gpio 8. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 178 smsc lan9313/lan9313i datasheet 13.1.4.11 gpio 9 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_9) this read only register combined with the gpio 9 1588 clock low-dword capture register (1588_clock_lo_capture_gpio_9) form the 64-bit gpio 9 timestamp capture. offset: 168h size: 32 bits bits description type default 31:0 timestamp high (ts_hi) this field contains the high 32-bits of the timestamp upon activation of gpio 9. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 179 revision 2.0 (02-14-13) datasheet 13.1.4.12 gpio 9 1588 clock low-dword captur e register (1588_clock_lo_capture_gpio_9) this read only register combined with the gpio 9 1588 clock high-dword capture register (1588_clock_hi_capture_gpio_9) form the 64-bit gpio 9 timestamp capture. offset: 16ch size: 32 bits bits description type default 31:0 timestamp low (ts_lo) this field contains the low 32-bits of the timestamp upon activation of gpio 9. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 180 smsc lan9313/lan9313i datasheet 13.1.4.13 1588 clock high-dword register (1 588_clock_hi) this read/write regi ster combined with 1588 clock low-dword register (1588_clock_lo) form the 64-bit 1588 clock value. the 1588 clock value is used for all 1588 timestamping. the 1588 clock has a base frequency of 100mhz, which can be adjusted via the 1588 clock addend register (1588_clock_addend) accordingly. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock low-dword register (1588_clock_lo) must be written for either to be affected. note: the value read is the saved value of the 1588 clock when the 1588_clock_snapshot bit in the 1588 command register (1588_cmd) is set. offset: 170h size: 32 bits bits description type default 31:0 clock high (clock_hi) this field contains the high 32-bits of the 64-bit 1588 clock. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 181 revision 2.0 (02-14-13) datasheet 13.1.4.14 1588 clock low-dword register (1 588_clock_lo) this read/write regi ster combined with 1588 clock high-dword register (1588_clock_hi) form the 64-bit 1588 clock value. the 1588 clock value is used for all 1588 timestamping. the 1588 clock has a base frequency of 100mhz, which can be adjusted via the 1588 clock addend register (1588_clock_addend) accordingly. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock high-dword register (1588_clock_hi) must be written for either to be affected. note: the value read is the saved value of the 1588 clock when the 1588_clock_snapshot bit in the 1588 command register (1588_cmd) is set. offset: 174h size: 32 bits bits description type default 31:0 clock low (clock_lo) this field contains the low 32-bits of the 64-bit 1588 clock. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 182 smsc lan9313/lan9313i datasheet 13.1.4.15 1588 clock addend register (1588_clock_addend) this read/write register is responsible for ad justing the 64-bit 1588 clock frequency. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for details on how to properly use this register. offset: 178h size: 32 bits bits description type default 31:0 clock addend (clock_addend) this 32-bit value is added to the 15 88 frequency diviso r accumulator every cycle. this allows the base 100mhz frequency of the 64-bit 1588 clock to be adjusted accordingly. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 183 revision 2.0 (02-14-13) datasheet 13.1.4.16 1588 clock target high-dwo rd register (158 8_clock_target_hi) this read/write register combined with 1588 clock target low-dword register (1588_clock_target_lo) form the 64-bit 1588 clock target value. the 1588 clock target value is compared to the current 1588 clock value and can be used to trigger an interrupt upon at match. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock target low-dword register (1588_clock_target_lo) must be written for either to be affected. offset: 17ch size: 32 bits bits description type default 31:0 clock target high (clock_target_hi) this field contains the high 32-bits of the 64-bit 1588 clock compare value. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 184 smsc lan9313/lan9313i datasheet 13.1.4.17 1588 clock target low-dword register (1588_ clock_target_lo) this read/write register combined with 1588 clock target high-dword register (1588_clock_target_hi) form the 64-bit 1588 clock target value. the 1588 clock target value is compared to the current 1588 clock value and can be used to trigger an interrupt upon at match. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock target high-dword register (1588_clock_target_hi) must be written for either to be affected. offset: 180h size: 32 bits bits description type default 31:0 clock target low (clock_target_lo) this field contains the low 32-bits of the 64-bit 1588 clock compare value. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 185 revision 2.0 (02-14-13) datasheet 13.1.4.18 1588 clock target reload high-dwo rd register (1588_clock_target_reload_hi) this read/write regi ster combined with 1588 clock target reload/add low-dword register (1588_clock_targ et_reload_lo) form the 64-bit 1588 clock target reload value. the 1588 clock target reload is the value that is reloaded to the 1588 clock compare value when a clock compare event occurs and the reload/add (reload_add) bit of the 1588 configuration register (1588_config) is set. refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock target reload/add low-dword register (1588_clock_target_reload_lo) must be written for either to be affected. offset: 184h size: 32 bits bits description type default 31:0 clock target reload high (clock_target_reload_hi) this field contains the high 32-bits of the 64-bit 1588 clock target reload value that is reloaded to the 1588 clock compare value. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 186 smsc lan9313/lan9313i datasheet 13.1.4.19 1588 clock target reload/add low-dword register (1588_clock_target_reload_lo) this read/write register combined with 1588 clock target reload high-dword register (1588_clock_target_reload_hi) form the 64-bit 1588 clock target reload value. the 1588 clock target reload is the value that is reloaded or added to the 1588 clock compare value when a clock compare event occurs. whether this value is reloaded or added is determined by the reload/add (reload_add) bit of the 1588 configuration register (1588_config) . refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. note: both this register and the 1588 clock target reload high-dword register (1588_clock_target_reload_hi) must be written for either to be affected. offset: 188h size: 32 bits bits description type default 31:0 clock target reload low (clock_target_reload_lo) this field contains the low 32-bits of the 64-bit 1588 clock target reload value that is reloaded to the 1588 clock compare value. alternatively, these 32-bits are added to the 1588 clock compare value when configured accordingly. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 187 revision 2.0 (02-14-13) datasheet 13.1.4.20 1588 auxiliary mac address high-word register (1588_aux_mac_hi) this read/write register combined with the 1588 auxiliary mac address low-dword register (1588_aux_mac_lo) forms the 48-bit auxiliary (user defined) mac address. the auxiliary mac address can be enabled for each port of the lan9313/lan9313i via their respective user defined mac address enable bit in the 1588 configuration register (1588_config) . refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. offset: 18ch size: 32 bits bits description type default 31:16 reserved ro - 15:0 auxiliary mac address high (aux_mac_hi) this field contains the high 16-bits of the auxiliary mac address used for ptp packet detection. r/w 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 188 smsc lan9313/lan9313i datasheet 13.1.4.21 1588 auxiliary mac address low-dword register (1588_aux_mac_lo) this read/write regist er combined with the 1588 auxiliary mac address high-word register (1588_aux_mac_hi) forms the 48-bit auxiliary (user defi ned) mac address. the auxiliary mac address can be enabled for each port of the lan9313/lan9313i via their respective user defined mac address enable bit in the 1588 configuration register (1588_config) . refer to chapter 10, "ieee 1588 hardware time stamp unit," on page 138 for additional information. offset: 190h size: 32 bits bits description type default 31:0 auxiliary mac addr ess low (aux_mac_lo) this field contains the low 32-bits of the auxiliary mac address used for ptp packet detection. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 189 revision 2.0 (02-14-13) datasheet 13.1.4.22 1588 configuration register (1588_config) this read/write register is responsible for the configuration of the 1588 timestamps for all ports. offset: 194h size: 32 bits bits description type default 31 master/slave port 2 (m_ns_2) when set, port 2 is a time clock master and captures timestamps when a sync packet is transmitted and when a delay_req is received. when cleared, port 2 is a time clock slave and captures timestamps when a delay_req packet is transmitted and when a sync packet is received. r/w 0b 30 primary mac address enable port 2 (mac_pri_en_2) this bit enables/disables the primary mac address on port 2. 0: disables primary mac address on port 2 1: enables mac address 01:00:5e:00: 01:81 as a ptp address on port 2 r/w 1b 29 alternate mac address 1 enab le port 2 (mac_alt1_en_2) this bit enables/disables the alternate mac address 1 on port 2. 0: disables alternate mac address on port 2 1: enables mac address 01:00:5e:00: 01:82 as a ptp address on port 2 r/w 0b 28 alternate mac address 2 enab le port 2 (mac_alt2_en_2) this bit enables/disables the alternate mac address 2 on port 2. 0: disables alternate mac address on port 2 1: enables mac address 01:00:5e:00: 01:83 as a ptp address on port 2 r/w 0b 27 alternate mac address 3 enab le port 2 (mac_alt3_en_2) this bit enables/disables the alternate mac address 3 on port 2. 0: disables alternate mac address on port 2 1: enables mac address 01:00:5e:00: 01:84 as a ptp address on port 2 r/w 0b 26 user defined mac address enable port 2 (mac_user_en_2) this bit enables/disables the auxiliary mac address on port 2. the auxiliary address is defined via the 1588_aux_mac_hi and 1588_aux_mac_lo registers. 0: disables auxiliary mac address on port 2 1: enables auxiliary mac address as a ptp address on port 2 r/w 0b 25 lock enable rx port 2 (lock_rx_2) this bit enables/disables the rx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 rx interrupt for port 2 is already set due to a previous capture. 0: disables rx port 2 lock 1: enables rx port 2 lock r/w 1b 24 lock enable tx port 2 (lock_tx_2) this bit enables/disables the tx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 tx interrupt for port 2 is already set due to a previous capture. 0: disables tx port 2 lock 1: enables tx port 2 lock r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 190 smsc lan9313/lan9313i datasheet 23 master/slave port 1 (m_ns_1) when set, port 1 is a time clock master and captures timestamps when a sync packet is transmitted and when a delay_req is received. when cleared, port 1 is a time clock slave and captures timestamps when a delay_req packet is transmitted and when a sync packet is received. r/w 0b 22 primary mac address enable port 1 (mac_pri_en_1) this bit enables/disables the primary mac address on port 1. 0: disables primary mac address on port 1 1: enables mac address 01:00:5e:00: 01:81 as a ptp address on port 1 r/w 1b 21 alternate mac address 1 enab le port 1 (mac_alt1_en_1) this bit enables/disables the alternate mac address 1 on port 1. 0: disables alternate mac address on port 1 1: enables mac address 01:00:5e:00: 01:82 as a ptp address on port 1 r/w 0b 20 alternate mac address 2 enab le port 1 (mac_alt2_en_1) this bit enables/disables the alternate mac address 2 on port 1. 0: disables alternate mac address on port 1 1: enables mac address 01:00:5e:00: 01:83 as a ptp address on port 1 r/w 0b 19 alternate mac address 3 enab le port 1 (mac_alt3_en_1) this bit enables/disables the alternate mac address 3 on port 1. 0: disables alternate mac address on port 1 1: enables mac address 01:00:5e:00: 01:84 as a ptp address on port 1 r/w 0b 18 user defined mac address enable port 1 (mac_user_en_1) this bit enables/disables the auxiliary mac address on port 1. the auxiliary address is defined via the 1588_aux_mac_hi and 1588_aux_mac_lo registers. 0: disables auxiliary mac address on port 1 1: enables auxiliary mac address as a ptp address on port 1 r/w 0b 17 lock enable rx port 1 (lock_rx_1) this bit enables/disables the rx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 rx interrupt for port 1 is ready set due to a previous capture. 0: disables rx port 1 lock 1: enables rx port 1 lock r/w 1b 16 lock enable tx port 1 (lock_tx_1) this bit enables/disables the tx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 tx interrupt for port 1 is ready set due to a previous capture. 0: disables tx port 1 lock 1: enables tx port 1 lock r/w 1b 15 master/slave port 0(external mii)(m_ns_mii) when set, port 0 is a time clock master and captures timestamps when a sync packet is transmitted and when a delay_req is received. when cleared, port 0 is a time clock slave and captures timestamps when a delay_req packet is transmitted and when a sync packet is received. note: for port 0, receive is defined as data from the switch fabric, while transmit is defined as data to the switch fabric. r/w 0b 14 primary mac address enable port 0(external mii) (mac_pri_en_mii) this bit enables/disables the primary mac address on port 0. 0: disables primary mac address on port 0 1: enables mac address 01:00:5e:00: 01:81 as a ptp address on port 0 r/w 1b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 191 revision 2.0 (02-14-13) datasheet 13 alternate mac address 1 enab le port 0(external mii) (mac_alt1_en_mii) this bit enables/disables the alternate mac address 1 on port 0. 0: disables alternate mac address on port 0 1: enables mac address 01:00:5e:00: 01:82 as a ptp address on port 0 r/w 0b 12 alternate mac address 2 enab le port 0(external mii) (mac_alt2_en_mii) this bit enables/disables the alternate mac address 2 on port 0. 0: disables alternate mac address on port 0 1: enables mac address 01:00:5e:00: 01:83 as a ptp address on port 0 r/w 0b 11 alternate mac address 3 enab le port 0(external mii) (mac_alt3_en_mii) this bit enables/disables the alternate mac address 3 on port 0. 0: disables alternate mac address on port 0 1: enables mac address 01:00:5e:00: 01:84 as a ptp address on port 0 r/w 0b 10 user defined mac address enable port 0(external mii) (mac_user_en_mii) this bit enables/disables the auxiliary mac address on port 0. the auxiliary address is defined via the 1588_aux_mac_hi and 1588_aux_mac_lo registers. 0: disables auxiliary mac address on port 0 1: enables auxiliary mac address as a ptp address on port 0 r/w 0b 9 lock enable rx port 0(ex ternal mii) (lock_rx_mii) this bit enables/disables the rx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 rx interrupt for port 0 is ready set due to a previous capture. 0: disables rx port 0 lock 1: enables rx port 0 lock note: for port 0, receive is defined as data from the switch fabric, while transmit is to the switch fabric. r/w 1b 8 lock enable tx port 0(external mii) (lock_tx_mii) this bit enables/disables the tx lock. this lock prevents a 1588 capture from overwriting the clock, uudi and sequence id values if the 1588 tx interrupt for port 0 is ready set due to a previous capture. 0: disables tx port 0 lock 1: enables tx port 0 lock note: for port 0, receive is defined as data from the switch fabric, while transmit is to the switch fabric. r/w 1b 7 reserved ro - 6 lock enable gpio 9 (lock_gpio_9) this bit enables/disables the gpio 9 lock. this lock prevents a 1588 capture from overwriting the clock value if the 1588_gpio9 interrupt in the 1588 interrupt status and enable register (1588_int_sts_en) is already set due to a previous capture. 0: disables gpio 9 lock 1: enables gpio 9 lock r/w 1b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 192 smsc lan9313/lan9313i datasheet 5 lock enable gpio 8 (lock_gpio_8) this bit enables/disables the gpio 8 lock. this lock prevents a 1588 capture from overwriting the clock value if the 1588_gpio8 interrupt in the 1588 interrupt status and enable register (1588_int_sts_en) is already set due to a previous capture. 0: disables gpio 8 lock 1: enables gpio 8 lock r/w 1b 4:3 gpio 9 clock event mode (gpio_event_9) these bits determine the output on gpio 9 when a clock target compare event occurs. 00: 100ns pulse output 01: toggle output 10: 1588_timer_int bit value in the 1588_int_sts_en register output 11: reserved note: the 1588_gpio_oe[9] bit in the general purpose i/o configuration register (gpio_cfg) must be set in order for the gpio output to be controlled by the 1588 block. note: the polarity of the pulse or level is set by the gpio_event_pol_9 bit in the general purpose i/o configuration register (gpio_cfg) . the gpiobuf[9] bit still determines the gpio buffer type. r/w 00b 2:1 gpio 8 clock event mode (gpio_event_8) these bits determine the output on gpio 8 when a clock target compare event occurs. 00: 100ns pulse output 01: toggle output 10: 1588_timer_int bit value in the 1588_int_sts_en register output 11: reserved note: the 1588_gpio_oe[8] bit in the general purpose i/o configuration register (gpio_cfg) must be set in order for the gpio output to be controlled by the 1588 block. note: the polarity of the pulse or level is set by the gpio_event_pol_8 bit in the general purpose i/o configuration register (gpio_cfg) . the gpiobuf[8] bit still determines the gpio buffer type. r/w 00b 0 reload/add (reload_add) this bit determines the course of action when a clock target compare event occurs. when set, the 1588 clock target high-dword register (1588_clock_target_hi) and 1588 clock target low-dword register (1588_clock_target_lo) are loaded from the 1588 clock target reload high-dword register (1588_clock_target_reload_hi) and 1588 clock target reload/add low-dword register (1588_clock_target_reload_lo) when a clock target compare event occurs. when low, the clock target low and high registers are incremented by the clock target reload low register when a clock target compare event occurs. 0: reload upon a cloc k target compare event 1: increment upon a clock target compare event r/w 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 193 revision 2.0 (02-14-13) datasheet 13.1.4.23 1588 interrupt status and enable register (1588_int_sts_en) this read/write register contains the ieee 1588 interrupt status and enable bits. writing a 1 to any of the interrupt status bits acknowledges and clears the interrupt. if enabled, these interrupt bits are cascaded into bit 29 (1588_evnt) of the interrupt status register (int_sts) . writing a 1 to any of the interrupt enable bits will enable the corresponding interrupt as a source. status bits will still reflect the status of the interrupt source regardless of whether the source is enabled as an interrupt in this register. bit 29 (1588_evnt_en) of the interrupt enable register (int_en) must also be set in order for an actual system level interrupt to occur. refer to chapter 5, "system interrupts," on page 55 for additional information. offset: 198h size: 32 bits bits description type default 31:25 reserved ro - 24 1588 port 2 rx interrupt enable (1588_port2_rx_en) r/w 0b 23 1588 port 2 tx interrupt enable (1588_port2_tx_en) r/w 0b 22 1588 port 1 rx interrupt enable (1588_port1_rx_en) r/w 0b 21 1588 port 1 tx interrupt enable (1588_port1_tx_en) r/w 0b 20 1588 port 0(external mii) rx in terrupt enable (1588_mii_rx_en) r/w 0b 19 1588 port 0(external mii) tx interrupt enable (1588_mii_tx_en) r/w 0b 18 gpio9 1588 interrupt en able (1588_gpio9_en) r/w 0b 17 gpio8 1588 interrupt en able (1588_gpio8_en) r/w 0b 16 1588 timer interrupt enable (1588_timer_en) r/w 0b 15:9 reserved ro - 8 1588 port 2 rx interrupt (1588_port2_rx_int) this interrupt indicates that a packet received by port 2 matches the configured ptp packet and the 1588 clock was captured. r/wc 0b 7 1588 port 2 tx interrupt (1588_port2_tx_int) this interrupt indicates that a packet transmitted by port 2 matches the configured ptp packet and the 1588 clock was captured. r/wc 0b 6 1588 port 1 rx interrupt (1588_port1_rx_int) this interrupt indicates that a packet received by port 1 matches the configured ptp packet and the 1588 clock was captured. r/wc 0b 5 1588 port 1 tx interrupt (1588_port1_tx_int) this interrupt indicates that a packet transmitted by port 1 matches the configured ptp packet and the 1588 clock was captured. r/wc 0b 4 1588 port 0(external mii) rx interrupt (1588_mii_rx_int) this interrupt indicates that a packet from the switch fabric to the external mii the matches the configured ptp packet and the 1588 clock was captured. note: for port 0, receive is defined as data from the switch fabric, while transmit is to the switch fabric. r/wc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 194 smsc lan9313/lan9313i datasheet 3 1588 port 0(external mii) tx interrupt (1588_mii_tx_int) this interrupt indicates that a packet from the external mii to the switch fabric matches the configured ptp packet and the 1588 clock was captured. note: for port 0, receive is defined as data from the switch fabric, while transmit is to the switch fabric. r/wc 0b 2 1588 gpio9 interrupt (1588_gpio9_int) this interrupt indicates that an event on gpio9 occurred and the 1588 clock was captured. these interrupts are configured through the general purpose i/o configuration register (gpio_cfg) register. note: as 1588 capture inputs, gpio inputs are edge sensitive and must be active for greater than 40 ns to be recognized as interrupt inputs. r/wc 0b 1 1588 gpio8 interrupt (1588_gpio8_int) this interrupt indicates that an event on gpio8 occurred and the 1588 clock was captured. these interrupts are configured through the general purpose i/o configuration register (gpio_cfg) register. note: as 1588 capture inputs, gpio inputs are edge sensitive and must be active for greater than 40 ns to be recognized as interrupt inputs. r/wc 0b 0 1588 timer interrupt (1588_timer_int) this interrupt indicates that the 1588 clock equaled or passed the clock target value in the 1588 clock target high-dword register (1588_clock_target_hi) and 1588 clock target low-dword register (1588_clock_target_lo) . note: this bit is also cleared by an active edge on gpio[9:8] if enabled. for the clear function, gpio inputs are edge sensitive and must be active for greater than 40 ns to be recognized as a clear input. refer to section 12.2, "gpio operation," on page 146 for additional information. r/wc 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 195 revision 2.0 (02-14-13) datasheet 13.1.4.24 1588 command register (1588_cmd) this register is used to issue 1588 commands. using the clock snapshot bit allows the host to properly read the current ieee 1588 clock values from the 1588 clock high-dword register (1588_clock_hi) and 1588 clock low-dword register (1588_clock_lo) . refer to section section 10.3, "ieee 1588 clock," on page 143 for additional information. offset: 19ch size: 32 bits bits description type default 31:1 reserved ro - 0 clock snapshot (1588_clock_snapshot) setting this bit causes the current 1588 clock high-dword register (1588_clock_hi) and 1588 clock low-dword register (1588_clock_lo) values to be saved so they can be read. wo sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 196 smsc lan9313/lan9313i datasheet 13.1.5 switch fabric this section details the memory mapped system csrs which are related to the switch fabric. the flow control of all three ports of the switch fabric can be configured via the memory mapped system csrs manual_fc_1, manual_fc_2 and manual_fc_mii. the mac address used by the switch for pause frames is configured via the swit ch_mac_addrh and switch_mac_addrl registers. in addition, the switch_csr_cmd, switch_csr_data and switch_csr_direct_data registers serve as a memory mapped accessible inte rface to the full range of otherwise inaccessible switch control and status registers. a list of all the switch fabric csrs can be seen in ta b l e 1 3 . 1 2 . for additional information on the switch fabric, including a full explanation on how to use the switch fabric csr interface registers, refer to chapter 6, "switch fabric," on page 60 . for detailed descriptions of the switch fabric csrs that are accessible via these interface registers, refer to section section 13.3, "switch fabric control and status registers" . 13.1.5.1 port 1 manual flow control register (manual_fc_1) this read/write register allows for the manual configuration of the switch port 1 flow control. this register also provides read back of the currently enabled flow control settings, whether set manually or auto-negotiated. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note: the flow control values in the phy_an_adv_1 register (see section 13.2.2.5, on page 243 ) within the phy are not affected by the values of this register. offset: 1a0h size: 32 bits bits description type default 31:7 reserved ro - 6 port 1 backpressure enable (bp_en_1) this bit enables/disables the generation of half-duplex backpressure on switch port 1. 0: disable backpressure 1: enable backpressure r/w note 13.4 5 port 1 current duplex (cur_dup_1) this bit indicates the actual duplex setting of switch port 1. 0: full-duplex 1: half-duplex ro note 13.5 4 port 1 current receive flow control enable (cur_rx_fc_1) this bit indicates the actual receive flow setting of switch port 1. 0: flow control receive is currently disabled 1: flow control receiv e is currently enabled ro note 13.5 3 port 1 current transmit flow control enable (cur_tx_fc_1) this bit indicates the actual transmit flow setting of switch port 1. 0: flow control transmit is currently disabled 1: flow control transmit is currently enabled ro note 13.5 2 port 1 full-duplex receive flow control enable (rx_fc_1) when the manual_fc_1 bit is set, or auto-negotiation is disabled, this bit enables/disables the detection of full-duplex pause packets on switch port 1. 0: disable flow control receive 1: enable flow control receive r/w note 13.6 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 197 revision 2.0 (02-14-13) datasheet note 13.4 the default value of this field is determined by the bp_en_strap_1 configuration strap. the strap values are loaded during reset and ca n be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.5 the default value of this bit is determined by multiple strap settings. the strap values are loaded during reset and can be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note 13.6 the default value of this field is determined by the fd_fc_strap_1 configuration strap. the strap values are loaded during reset and ca n be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.7 the default value of this field is determined by the manual_fc_strap_1 configuration strap. the strap values are loaded during reset and can be re-w ritten by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. 1 port 1 full-duplex transmit flow control enable (tx_fc_1) when the manual_fc_1 bit is set, or auto-negotiation is disabled, this bit enables/disables full-duplex pause packets to be generated on switch port 1. 0: disable flow control transmit 1: enable flow control transmit r/w note 13.6 0 port 1 full-duplex manual flow control select (manual_fc_1) this bit toggles flow control selection between manual and auto-negotiation. 0: if auto-negotiation is enable d, the auto-negotiation function determines the flow control of sw itch port 1 (rx_fc_1 and tx_fc_1 values ignored). if auto-negotiati on is disabled, the rx_fc_1 and tx_fc_1 values are used. 1: tx_fc_1 and rx_fc_1 bits determin e the flow control of switch port 1 when in full-duplex mode r/w note 13.7 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 198 smsc lan9313/lan9313i datasheet 13.1.5.2 port 2 manual flow control register (manual_fc_2) this read/write register allows for the manual configuration of the switch port 2 flow control. this register also provides read back of the currently enabled flow control settings, whether set manually or auto-negotiated. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note: the flow control values in the phy_an_adv_2 register (see section 13.2.2.5, on page 243 ) within the phy are not affected by the values of this register. offset: 1a4h size: 32 bits bits description type default 31:7 reserved ro - 6 port 2 backpressure enable (bp_en_2) this bit enables/disables the generation of half-duplex backpressure on switch port 2. 0: disable backpressure 1: enable backpressure r/w note 13.8 5 port 2 current duplex (cur_dup_2) this bit indicates the actual duplex setting of switch port 2. 0: full-duplex 1: half-duplex ro note 13.9 4 port 2 current receive flow control enable (cur_rx_fc_2) this bit indicates the actual receive flow setting of switch port 2. 0: flow control receive is currently disabled 1: flow control receiv e is currently enabled ro note 13.9 3 port 2 current transmit flow control enable (cur_tx_fc_2) this bit indicates the actual transmit flow setting of switch port 2. 0: flow control transmit is currently disabled 1: flow control transmit is currently enabled ro note 13.9 2 port 2 full-duplex receive flow control enable (rx_fc_2) when the manual_fc_2 bit is set, or auto-negotiation is disabled, this bit enables/disables the detection of full-duplex pause packets on switch port 2. 0: disable flow control receive 1: enable flow control receive r/w note 13.10 1 port 2 full-duplex transmit flow control enable (tx_fc_2) when the manual_fc_2 bit is set, or auto-negotiation is disabled, this bit enables/disables full-duplex pause packets to be generated on switch port 2. 0: disable flow control transmit 1: enable flow control transmit r/w note 13.10 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 199 revision 2.0 (02-14-13) datasheet note 13.8 the default value of this field is determined by the bp_en_strap_2 configuration strap. the strap values are loaded during reset and ca n be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.9 the default value of this bit is determined by multiple strap settings. the strap values are loaded during reset and can be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note 13.10 the default value of this field is determined by the fd_fc_strap_2 configuration strap. the strap values are loaded during reset and ca n be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.11 the default value of this field is determined by the manual_fc_strap_2 configuration strap. the strap values are loaded during reset and can be re-w ritten by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. 0 port 2 full-duplex manual flow control select (manual_fc_2) this bit toggles flow control selection between manual and auto-negotiation. 0: if auto-negotiation is enable d, the auto-negotiation function determines the flow control of sw itch port 2 (rx_fc_2 and tx_fc_2 values ignored). if auto-negotiati on is disabled, the rx_fc_2 and tx_fc_2 values are used. 1: tx_fc_2 and rx_fc_2 bits determin e the flow control of switch port 2 when in full-duplex mode r/w note 13.11 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 200 smsc lan9313/lan9313i datasheet 13.1.5.3 port 0(external mii) manual flow control register (manual_fc_mii) this read/write register allows for the manual configuration of the switch port 0(external mii) flow control. this register also provides read back of the currently enabled flow control settings, whether set manually or auto-negotiated. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note: the flow control values in the section 13.1.7.5, "virtual phy auto-negotiation advertisement register (vphy_an_adv)," on page 220 are not affected by the values of this register. offset: 1a8h size: 32 bits bits description type default 31:7 reserved ro - 6 port 0 backpressure enable (bp_en_mii) this bit enables/disables the generation of half-duplex backpressure on switch port 0. 0: disable backpressure 1: enable backpressure r/w note 13.12 5 port 0 current duplex (cur_dup_mii) this bit indicates the actual duplex setting of the switch port 0. 0: full-duplex 1: half-duplex ro note 13.13 4 port 0 current receive flow co ntrol enable (cur_rx_fc_mii) this bit indicates the actual receive flow setting of switch port 0 0: flow control receive is currently disabled 1: flow control receiv e is currently enabled ro note 13.13 3 port 0 current transmit flow control enable (cur_tx_fc_mii) this bit indicates the actual transmit flow setting of switch port 0. 0: flow control transmit is currently disabled 1: flow control transmit is currently enabled ro note 13.13 2 port 0 receive flow cont rol enable (rx_fc_mii) when the manual_fc_mii bit is set, or virtual auto-negotiation is disabled, this bit enables/disables the detection of full-duplex pause packets on switch port 0. 0: disable flow control receive 1: enable flow control receive r/w note 13.14 1 port 0 transmit flow control enable (tx_fc_mii) when the manual_fc_mii bit is set, or virtual auto-negotiation is disabled, this bit enables/disables full-duplex pause packets to be generated on switch port 0. 0: disable flow control transmit 1: enable flow control transmit r/w note 13.14 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 201 revision 2.0 (02-14-13) datasheet note 13.12 the default value of this field is determined by the bp_en_strap_mii configuration strap. the strap value is loaded during reset and can be re-written by the eeprom loader. once the eeprom loader re-writes the value, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.13 the default value of this bit is determined by multiple strap settings. the strap values are loaded during reset and can be re-written by the eeprom loader. once the eeprom loader re-writes the values, this register is updated with the new values. refer to section 6.2.3, "flow control enable logic," on page 63 for additional information. note 13.14 the default value of this field is determined by the fd_fc_strap_mii configuration strap. the strap value is loaded during reset and can be re-written by the eeprom loader. once the eeprom loader re-writes the value, this register is updated with the new values. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.15 this bit is ro when in mac mode. note 13.16 the default value of this field is determined by the manual_fc_strap_mii configuration strap. the strap value is loaded during reset and can be re -written by the eeprom loader. once the eeprom loader re-writes the value, this register is updated with the new values. in mac mode, this bit is not re-written by the eeprom loader and has a default value of 1. see section 4.2.4, "configuration straps," on page 47 for more information. 0 port 0 full-duplex manual flow control select (manual_fc_mii) this bit toggles flow control selection between manual and auto-negotiation. 0: if auto-negotiation is enable d, the auto-negotiation function determines the flow control of switch port 0 (rx_fc_mii and tx_fc_mii values ignored). if auto -negotiation is disabled, the rx_fc_mii and tx_fc_mii values are used. 1: tx_fc_mii and rx_fc_mii bits dete rmine the flow control of switch port 0 when in full-duplex mode note: in mac mode, this bit is forced high. the virtual phy is not applicable in this mode and full-duplex flow control should be controlled manually by the host based on the external phys auto- negotiation results. r/w note 13.15 note 13.16 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 202 smsc lan9313/lan9313i datasheet 13.1.5.4 switch fabric csr interface data register (switch_csr_data) this read/write register is used in conjunction with the switch fabric csr interface command register (switch_csr_cmd) to perform read and write operations with the switch fabric csrs. refer to section 13.3, "switch fabric control and status registers," on page 257 for details on the registers indirectly accessible via this register. offset: 1ach size: 32 bits bits description type default 31:0 switch csr data (csr_data) this field contains the value read from or written to the switch fabric csr. the switch fabric csr is selected via the csr address (csr_addr[15:0]) bits of the switch fabric csr interface command register (switch_csr_cmd) . upon a read, the value returned depends on the r/nw bit in the switch fabric csr interface command register (switch_csr_cmd) . if r/nw is set, the data is from the switch fabric. if r/nw is cleared, the data is the value that was last writ ten into this register. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 203 revision 2.0 (02-14-13) datasheet 13.1.5.5 switch fabric csr interface command register (switch_csr_cmd) this read/write register is used in conjunction with the switch fabric csr interface data register (switch_csr_data) to control the read and write operations to the various switch fabric csrs. refer to section 13.3, "switch fabric control and status registers," on page 257 for details on the registers indirectly accessible via this register. offset: 1b0h size: 32 bits bits description type default 31 csr busy (csr_busy) when a 1 is written to this bit, the read or write operation (as determined by the r_nw bit) is performed to the specified switch fabric csr in csr address (csr_addr[15:0]) . this bit will remain set until the operation is complete, at which time the bit will clear. in the case of a read, the clearing of this bit indicates to the host that valid data can be read from the switch fabric csr interface data register (switch_csr_data) . the switch_csr_cmd and switch_csr_data registers should not be modified until this bit is cleared. r/w sc 0b 30 read/write (r_nw) this bit determines whether a read or write operation is performed by the host to the specified switch engine csr. 0: write 1: read r/w 0b 29 auto increment (auto_inc) this bit enables/disables the auto increment feature. when this bit is set, a write to the switch fabric csr interface data register (switch_csr_data) register will automatically set the csr busy (csr_busy) bit. once the write command is finished, the csr address (csr_addr[15:0]) will automatically increment. when this bit is set, a read from the switch fabric csr interface data register (switch_csr_data) will automatically increment the csr address (csr_addr[15:0]) and set the csr busy (csr_busy) bit. this bit should be cleared by software before the last read from the switch_csr_data register. 0: disable auto increment 1: enable auto increment note: this bit has precedence over the auto decrement (auto_dec) bit r/w 0b 28 auto decrement (auto_dec) this bit enables/disables the auto decrement feature. when this bit is set, a write to the switch fabric csr interface data register (switch_csr_data) will automatically set the csr busy (csr_busy) bit. once the write command is finished, the csr address (csr_addr[15:0]) will automatically decrement. when this bit is set, a read from the switch fabric csr interface data register (switch_csr_data) will automatica lly decrement the csr address (csr_addr[15:0]) and set the csr busy (csr_busy) bit. this bit should be cleared by software before the last read from the switch_csr_data register. 0: disable auto decrement 1: enable auto decrement r/w 0b 27:20 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 204 smsc lan9313/lan9313i datasheet 19:16 csr byte enable (csr_be[3:0]) this field is a 4-bit byte enable used for selection of valid bytes during write operations. bytes which are not selected will not be written to the corresponding swit ch engine csr. csr_be[3] corresponds to register data bits [31:24] csr_be[2] corresponds to register data bits [23:16] csr_be[1] corresponds to register data bits [15:8] csr_be[0] corresponds to register data bits [7:0] typically all four byte enables should be set for auto increment and auto decrement operations. r/w 0h 15:0 csr address (csr_addr[15:0]) this field selects the 16-bit address of the switch fabric csr that will be accessed with a read or write operation. refer to table 13.12, indirectly accessible switch control and status registers, on page 257 for a list of switch fabric csr addresses. r/w 00h bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 205 revision 2.0 (02-14-13) datasheet 13.1.5.6 switch fa bric mac address high register (switch_mac_addrh) this register contains the upper 16-bits of the mac address used by the switch for pause frames. this register is used in conjunction with switch fabric mac address low register (switch_mac_addrl) . the contents of this register are optionally loaded from the eeprom at power-on through the eeprom loader if a programm ed eeprom is detected. the least significant byte of this register (bits [7:0]) is loaded fr om address 05h of the eeprom. the second byte (bits [15:8]) is loaded from address 06h of the eeprom. the host can update the contents of this field after the initialization process has completed. refer to section 13.1.5.7, "switch fabric mac address low register (switch_mac_addrl)" for information on how this addre ss is loaded by the eeprom loader. section 8.2.4, "eeprom loader," on page 117 contains additional details on using the eeprom loader. offset: 1f0h size: 32 bits bits description type default 31:16 reserved ro - 15:0 physical address[47:32] this field contains the upper 16-bits (47:32) of the physical address of the switch fabric macs. r/w ffffh downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 206 smsc lan9313/lan9313i datasheet 13.1.5.7 switch fabric mac addres s low register (switch_mac_addrl) this register contains the lower 32-bits of the ma c address used by the switch for pause frames. this register is used in conjunction with switch fabric mac address high register (switch_mac_addrh) . the contents of this register are optionally loaded from the eeprom at power-on through the eeprom loader if a programm ed eeprom is detected. the least significant byte of this register (bits [7:0]) is loaded from address 01h of the eeprom. the most significant byte (bits [31:24]) is loaded from address 04h of the eeprom. the host can update the contents of this field after the initialization process has completed. refer to section 8.2.4, "eeprom loader," on page 117 for information on using the eeprom loader. table 13.2 illustrates the byte ordering of th e switch_mac_addrl and switch_mac_addrh registers with respect to the reception of the ethernet physical address. also shown is the correlation between the eeprom addresses and the switch_mac_addrl and switch_mac_addrh registers. for example, if the desired ethernet physical address is 12-34-56-78-9a-bc, the switch_mac_addrl and switch_mac_addrh registers would be programmed as shown in figure 13.2 . the values required to automatically load this configuration from the eeprom are also shown. offset: 1f4h size: 32 bits bits description type default 31:0 physical address[31:0] this field contains the lower 32-bits (31:0) of the physical address of the switch fabric macs. r/w ff0f8000h table 13.2 switch_mac_addrl, switch_mac_addrh, and eeprom byte ordering eeprom address register location wri tten order of reception on ethernet 01h switch_mac_addrl[7:0] 1 st 02h switch_mac_addrl[15:8] 2 nd 03h switch_mac_addrl[23:16] 3 rd 04h switch_mac_addrl[31:24] 4 th 05h switch_mac_addrh[7:0] 5 th 06h switch_mac_addrh[15:8] 6 th downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 207 revision 2.0 (02-14-13) datasheet note: by convention, the right nibble of the left most byte of the ethernet address (in this example, the 2 of the 12h) is the most significant nibble and is transmitted/received first. figure 13.2 example swit ch_mac_addrl, switch_mac _addrh, and eeprom setup 12h 0 7 34h 8 15 56h 16 23 78h 24 31 9ah bch xx xx a5h 12h 34h 56h 78h 9ah bch 00h 01h 02h 03h 04h 05h 06h eeprom switch_mac_addrl switch_mac_addrh 0 78 15 16 23 24 31 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 208 smsc lan9313/lan9313i datasheet 13.1.5.8 switch fabric csr interface direct data register (switch_csr_direct_data) this write-only register set is used to perform direct ly addressed write operations to the switch fabric csrs. using this set of registers, writes can be di rectly addressed to select switch fabric registers, as specified in ta b l e 1 3 . 3 . writes within the switch fabric csr interface direct da ta register (switch_csr_direct_data) address range automatically set the appropriate address, set the four byte enable bits, clear the r/nw bit and set the busy bit in the switch fabric csr interface command register (switch_csr_cmd) . the completion of the writ e cycle is indicated when the busy bit is cleared. the addr ess that is set in the switch fabric csr interface command register (switch_csr_cmd) is mapped via table 13.3 . for more information on this method of writ ing to the switch fabric csrs, refer to section 6.2.3, "flow control enable logic," on page 63 . note: this set of registers is for write operations only. reads can be performed via the switch fabric csr interface command register (switch_csr_cmd) and switch fabric csr interface data register (switch_csr_data) registers only. offset: 200h - 2dch size: 32 bits bits description type default 31:0 switch csr data (csr_data) this field contains the value to be written to the corresponding switch fabric register. wo 00000000h table 13.3 switch fabric csr to switch_csr_direct_data address range map register name switch fabric csr register # switch_csr_direct_data address general switch csrs sw_reset 0001h 200h sw_imr 0004h 204h switch port 0 csrs mac_rx_cfg_mii 0401h 208h mac_tx_cfg_mii 0440h 20ch mac_tx_fc_settings_mii 0441h 210h mac_imr_mii 0480h 214h switch port 1 csrs mac_rx_cfg_1 0801h 218h mac_tx_cfg_1 0840h 21ch mac_tx_fc_settings_1 0841h 220h mac_imr_1 0880h 224h switch port 2 csrs mac_rx_cfg_2 0c01h 228h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 209 revision 2.0 (02-14-13) datasheet mac_tx_cfg_2 0c40h 22ch mac_tx_fc_settings_2 0c41h 230h mac_imr_2 0c80h 234h switch engine csrs swe_alr_cmd 1800h 238h swe_alr_wr_dat_0 1801h 23ch swe_alr_wr_dat_1 1802h 240h swe_alr_cfg 1809h 244h swe_vlan_cmd 180bh 248h swe_vlan_wr_data 180ch 24ch swe_diffserv_tbl_cmd 1811h 250h swe_diffserv_tbl_wr_data 1812h 254h swe_glb_ingress_ cfg 1840h 258h swe_port_ingress_cfg 1841h 25ch swe_admt_only_vlan 1842h 260h swe_port_state 1843h 264h swe_pri_to_que 1845h 268h swe_port_mirror 1846h 26ch swe_ingress_port_typ 1847h 270h swe_bcst_throt 1848h 274h swe_admt_n_member 1849h 278h swe_ingress_rate_cfg 184ah 27ch swe_ingress_rate_cmd 184bh 280h swe_ingress_rate_wr_data 184dh 284h swe_ingress_regen_tbl_mii 1855h 288h swe_ingress_regen_tbl_1 1856h 28ch swe_ingress_regen_tbl_2 1857h 290h swe_imr 1880h 294h buffer manager (bm) csrs bm_cfg 1c00h 298h bm_drop_lvl 1c01h 29ch bm_fc_pause_lvl 1c02h 2a0h table 13.3 switch fabric csr to switch_csr_direct_data address range map (continued) register name switch fabric csr register # switch_csr_direct_data address downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 210 smsc lan9313/lan9313i datasheet bm_fc_resume_lvl 1c03h 2a4h bm_bcst_lvl 1c04h 2a8h bm_rndm_dscrd_tbl_cmd 1c09h 2ach bm_rndm_dscrd_tbl_wdata 1c0ah 2b0h bm_egrss_port_type 1c0ch 2b4h bm_egrss_rate_00_01 1c0dh 2b8h bm_egrss_rate_02_03 1c0eh 2bch bm_egrss_rate_10_11 1c0fh 2c0h bm_egrss_rate_12_13 1c10h 2c4h bm_egrss_rate_20_21 1c11h 2c8h bm_egrss_rate_22_23 1c12h 2cch bm_vlan_mii 1c13h 2d0h bm_vlan_1 1c14h 2d4h bm_vlan_2 1c15h 2d8h bm_imr 1c20h 2dch table 13.3 switch fabric csr to switch_csr_direct_data address range map (continued) register name switch fabric csr register # switch_csr_direct_data address downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 211 revision 2.0 (02-14-13) datasheet 13.1.6 phy management interface (pmi) the pmi registers are used to indirectly access the phy registers. refer to section 13.2, "ethernet phy control and status registers," on page 235 for additional information on the phy registers. refer to section 9.3, "phy management interface (pmi)," on page 131 for information on the pmi. note: the virtual phy registers are not accessible via these registers. 13.1.6.1 phy management interface data register (pmi_data) this register is used in conjunction with the phy management interface access register (pmi_access) to perform read and write operations to the phys. note: the virtual phy registers are not accessible via these registers. offset: 0a4h size: 32 bits bits description type default 31:16 reserved ro - 15:0 mii data this field contains the value read from or written to the phys. for a write operation, this register should be first written with the desired data. for a read operation, the pmi_access regist er is first written and once the command is finished, this register will contain the return data. note: upon a read, the value returned depends on the mii write bit (miiwnr) in the phy management interf ace access register (pmi_access) . if miiwnr is 0, the data is from the phy. if miiwnr is 1, the data is the value that was last written into this register. r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 212 smsc lan9313/lan9313i datasheet 13.1.6.2 phy manageme nt interface access register (pmi_access) this register is used to cont rol the management cycles to the phys. a phy a ccess is initiated when this register is written. this register is used in conjunction with the phy management interface data register (pmi_data) to perform read and write operations to the phys. note: the virtual phy registers are not accessible via these registers. offset: 0a8h size: 32 bits bits description type default 31:16 reserved ro - 15:11 phy address (phy_addr) these bits select the phy devi ce being accesse d. refer to section 7.1.1, "phy addressing," on page 87 for information on phy address assignments. r/w 00000b 10:6 mii register index (miirinda) these bits select the desired mii register in the phy. refer to section 13.2, "ethernet phy control and status registers," on page 235 for detailed descriptions on all phy registers. r/w 00000b 5:2 reserved ro - 1 mii write (miiwnr) setting this bit informs the phy that the access will be a write operation using the phy management interface data register (pmi_data) . if this bit is cleared, the access will be a read operation, returning data into the phy management interface data register (pmi_data) . r/w 0b 0 mii busy (miibzy) this bit must be read as 0 before writing to the phy management interface data register (pmi_data) or phy management interface access register (pmi_access) registers. this bit is automatically set when this register is written. during a phy register access, this bit will be set, signifying a read or write access is in progress. this is a self-clearing (sc) bit that will return to 0 when the phy regist er access has completed. during a phy register write, the phy management interface data register (pmi_data) must be kept valid until this bit is cleared. during a phy register read, the phy management interface data register (pmi_data) register is invalid until the mac has cleared this bit. ro sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 213 revision 2.0 (02-14-13) datasheet 13.1.7 virtual phy this section details the virtual phy system csrs. these registers provide status and control information similar to that of a real phy while maintaining ieee 802. 3 compatibility. the virtual phy registers are addressable via the memory map, as described in table 13.1 , as well as serially via the mii management protocol (ieee 802.3 clause 22). when accessed serially, these registers are accessed through the mii management pins (in phy modes only) via the mii serial management protocol specifie d in ieee 802.3 clause 22. see section 2.3, "modes of operation," on page 24 for a detailed description of the various lan9313/lan 9313i modes. when being accessed serially, the virtual phy will respond when the phy address equals the address assigned by the phy_addr_sel_strap configuration strap, as defined in section 7.1.1, "phy addressing," on page 87 . a list of all virtual phy register indexes for serial access can be seen in table 13.4 . for more information on the virtual phy access modes, refer to section section 13.2 . for virtual phy functionality and operation information, see section 7.3, "virtual phy," on page 101 . note: all virtual phy registers follow the ieee 802.3 (clause 22.2.4) specified mii management register set. all functionality and bit definiti ons comply with these standards. the ieee 802.3 specified register index (in decimal) is included under the lan9313/lan9313i memory mapped offset of each virtual phy register as a reference. for additional information, refer to the ieee 802.3 specification. note: when serially accessed, the virt ual phy registers are only 16-bits wide, as is standard for mii management of phys. table 13.4 virtual phy mii serially adressable register index index # symbol register name 0 vphy_basic_ctrl virtual phy basic control register, section 13.1.7.1 1 vphy_basic_status virtual phy basic status register, section 13.1.7.2 2 vphy_id_msb virtual phy identification msb register, section 13.1.7.3 3 vphy_id_lsb virtual phy iden tification lsb register, section 13.1.7.4 4 vphy_an_adv virtual phy auto-negot iation advertisement register, section 13.1.7.5 5 vphy_an_lp_base_ability virtual phy auto-negotiation li nk partner base page ability register, section 13.1.7.6 6 vphy_an_exp virtual phy auto-neg otiation expansion register, section 13.1.7.7 31 vphy_spec_ctrl_status virtual phy special control/status register, section 13.1.7.8 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 214 smsc lan9313/lan9313i datasheet 13.1.7.1 virtual phy basic control register (vphy_basic_ctrl) this read/write register is used to configure the virtual phy. note: this register is re-written in its entirety by the eeprom loader following the release or reset or a reload command. refer to section 8.2.4, "eeprom loader," on page 117 for more information. offset: index (decimal): 1c0h 0 size: 32 bits bits description type default 31:16 reserved (see note 13.17 ) ro - 15 reset (vphy_rst) when set, this bit resets all the virtual phy registers to their default state. this bit is self clearing. 0: normal operation 1: reset r/w sc 0b 14 loopback (vphy_loopback) this bit enables/disables the loopback mode. when enabled, transmissions from the external mac are not sent to the switch fabric. instead, they are looped back onto the receive path. 0: loopback mode disabled (normal operation) 1: loopback mode enabled r/w 0b 13 speed select lsb (vphy_speed_sel_lsb) this bit is used to set the speed of the virtual phy when the auto- negotiation (vphy_an) bit is disabled. 0: 10 mbps 1: 100 mbps r/w 0b 12 auto-negotiation (vphy_an) this bit enables/disables auto-negotiation. when enabled, the speed select lsb (vphy_speed_sel_lsb) and duplex mode (vphy_duplex) bits are overridden. 0: auto-negotiation disabled 1: auto-negotiation enabled r/w 1b 11 power down (vphy_pwr_dwn) this bit is not used by the virtual phy and has no effect. r/w 0b 10 isolate (vphy_iso) this bit controls the mii input/output pins. when set and in phy mode, the mii output pins are not driven, mii pull-ups and pull-downs are disabled and the input pins are ignored. when in mac mode, this bit is ignored and has no effect. ( note 13.18 ) 0: non-isolated (normal operation) 1: isolated r/w 0b 9 restart auto-negotiation (vphy_rst_an) when set, this bit updates the emulated auto-negotiation results. 0: normal operation 1: auto-negotiation restarted r/w sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 215 revision 2.0 (02-14-13) datasheet note 13.17 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.18 the isolation does not apply to the mii management pins (mdio). 8 duplex mode (vphy_duplex) this bit is used to set the duplex when the auto-negotiation (vphy_an) bit is disabled. 0: half duplex 1: full duplex r/w 0b 7 collision test (vphy_col_test) this bit enables/disables the collisi on test mode. when set, the collision signal to the external mac is active during transmission from the external mac. note: it is recommended that this bit be used only when in loopback mode. 0: collision test mode disabled 1: collision test mode enabled r/w 0b 6 speed select msb (vphy_speed_sel_msb) this bit is not used by the virtual phy and has no effect. the value returned is always 0. ro 0b 5:0 reserved ro - bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 216 smsc lan9313/lan9313i datasheet 13.1.7.2 virtual phy basic status register (vphy_basic_status) this register is used to monitor the status of the virtual phy. offset: index (decimal): 1c4h 1 size: 32 bits bits description type default 31:16 reserved (see note 13.19 ) ro - 15 100base-t4 this bit displays the status of 100base-t4 compatibility. 0: phy not able to perform 100base-t4 1: phy able to perform 100base-t4 ro 0b note 13.20 14 100base-x full duplex this bit displays the status of 100base-x full duplex compatibility. 0: phy not able to perf orm 100base-x full duplex 1: phy able to perfor m 100base-x full duplex ro 1b 13 100base-x half duplex this bit displays the status of 100base-x half duplex compatibility. 0: phy not able to perf orm 100base-x half duplex 1: phy able to perfor m 100base-x half duplex ro 1b 12 10base-t full duplex this bit displays the status of 10base-t full duplex compatibility. 0: phy not able to perf orm 10base-t full duplex 1: phy able to perfor m 10base-t full duplex ro 1b 11 10base-t half duplex this bit displays the status of 10base-t half duplex compatibility. 0: phy not able to perform 10base-t half duplex 1: phy able to perform 10base-t half duplex ro 1b 10 100base-t2 full duplex this bit displays the status of 100base-t2 full duplex compatibility. 0: phy not able to perform 100base-t2 full duplex 1: phy able to perform 100base-t2 full duplex ro 0b note 13.20 9 100base-t2 half duplex this bit displays the status of 100base-t2 half duplex compatibility. 0: phy not able to perform 100base-t2 half duplex 1: phy able to perform 100base-t2 half duplex ro 0b note 13.20 8 extended status this bit displays whether extended status information is in register 15 (per ieee 802.3 clause 22.2.4). 0: no extended status in formation in register 15 1: extended status info rmation in register 15 ro 0b note 13.21 7 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 217 revision 2.0 (02-14-13) datasheet note 13.19 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.20 the virtual phy supports 100base-x (half and full duplex) and 10base-t (half and full duplex) only. all other modes will always return as 0 (unable to perform). note 13.21 the virtual phy does not support register 15 or 1000 mb/s operation. thus this bit is always returned as 0. note 13.22 the auto-negotiation complete bit is first cl eared on a reset, but se t shortly after (when the auto-negotiation process is run). refer to section 7.3.1, "virtual phy auto- negotiation," on page 101 for additional details. note 13.23 the virtual phy never has remote faults, its link is always up, and does not detect jabber. note 13.24 the virtual phy supports basic and some extended register capability. the virtual phy supports registers 0-6 (per the ieee 802.3 sp ecification). 6 mf preamble suppression this bit indicates whether the virtual phy accepts management frames with the preamble suppressed. 0: management frames with pr eamble suppressed not accepted 1: management frames with preamble suppressed accepted ro 0b 5 auto-negotiation complete this bit indicates the status of the auto-negotiation process. 0: auto-negotiation process not completed 1: auto-negotiation process completed ro 1b note 13.22 4 remote fault this bit indicates if a remote fault condition has been detected. 0: no remote fault condition detected 1: remote fault condition detected ro 0b note 13.23 3 auto-negotiation ability this bit indicates the status of the virtual phys auto-negotiation. 0: virtual phy is unable to perform auto-negotiation 1: virtual phy is able to perform auto-negotiation ro 1b 2 link status this bit indicates the status of the link. 0: link is down 1: link is up ro 1b note 13.23 1 jabber detect this bit indicates the status of the jabber condition. 0: no jabber co ndition detected 1: jabber condition detected ro 0b note 13.23 0 extended capability this bit indicates whether extended register capability is supported. 0: basic register set capabilities only 1: extended register set capabilities ro 1b note 13.24 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 218 smsc lan9313/lan9313i datasheet 13.1.7.3 virtual phy identificati on msb register (vphy_id_msb) this read/write register contains the msb of the virtual phy organizationally unique identifier (oui). the lsb of the virtual phy oui is contained in the virtual phy identification lsb register (vphy_id_lsb) . note 13.25 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.26 ieee allows a value of zero in each of the 32-bits of the phy identifier. offset: index (decimal): 1c8h 2 size: 32 bits bits description type default 31:16 reserved (see note 13.25 ) ro - 15:0 phy id this field contains the msb of the virtual phy oui ( note 13.26 ). r/w 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 219 revision 2.0 (02-14-13) datasheet 13.1.7.4 virtual phy identificati on lsb register (vphy_id_lsb) this read/write register contains the lsb of the virtual phy organizationally unique iden tifier (oui). the msb of the virtual phy oui is contained in the virtual phy identification msb register (vphy_id_msb) . note 13.27 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.28 ieee allows a value of zero in each of the 32-bits of the phy identifier. offset: index (decimal): 1cch3 size: 32 bits bits description type default 31:16 reserved (see note 13.27 ) ro - 15:10 phy id this field contains the lower 6-bits of the virtual phy oui ( note 13.28 ). r/w 000000b 9:4 model number this field contains the 6-bit manufacturers model number of the virtual phy ( note 13.28 ). r/w 000000b 3:0 revision number this field contain the 4-bit manufacturers revision number of the virtual phy ( note 13.28 ). r/w 0000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 220 smsc lan9313/lan9313i datasheet 13.1.7.5 virtual phy auto-negotiation advertisement register (vphy_an_adv) this read/write register contains the advertised ability of the virtual phy and is used in the auto- negotiation process with the link partner. note: this register is re-written in its entirety by the eeprom loader following the release or reset or a reload command. refer to section 8.2.4, "eeprom loader," on page 117 for more information. offset: index (decimal): 1d0h 4 size: 32 bits bits description type default 31:16 reserved (see note 13.29 ) ro - 15 next page this bit determines the advertised next page capability and is always 0. 0: virtual phy does not advertise next page capability 1: virtual phy advertise s next page capability ro 0b note 13.30 14 reserved ro - 13 remote fault this bit is not used since there is no physical link partner. ro 0b note 13.31 12 reserved ro - 11 asymmetric pause this bit determines the advertised asymmetric pause capability. 0: no asymmetric pause towa rd link partner advertised 1: asymmetric pause toward link partner advertised r/w 0b 10 pause this bit determines the advertised symmetric pause capability. 0: no symmetric pause towa rd link partner advertised 1: symmetric pause toward link partner advertised r/w note 13.32 9 100base-t4 this bit determines the advertised 100base-t4 capability and is always 0. 0: 100base-t4 ability not advertised 1: 100base-t4 ability advertised ro 0b note 13.33 8 100base-x full duplex this bit determines the advertised 100base-x full duplex capability. 0: 100base-x full duplex ability not advertised 1: 100base-x full duplex ability advertised r/w 1b 7 100base-x half duplex this bit determines the advertised 100base-x half duplex capability. 0: 100base-x half duplex ability not advertised 1: 100base-x half duplex ability advertised r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 221 revision 2.0 (02-14-13) datasheet note 13.29 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.30 the virtual phy does not support next page capability. this bit value will always be 0. note 13.31 the remote fault bit is not useful since there is no actual link partner to send a fault to. note 13.32 the pause bit defaults to 1 if the manual_fc_strap_mii strap is low, and 0 if th e manual_fc_strap_mii strap is high. configuration strap values are latched upon the de- assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . note 13.33 virtual 100base-t4 is not supported. note 13.34 the virtual phy supports only ieee 802.3. only a value of 00001b should be used in this field. 6 10base-t full duplex this bit determines the advertis ed 10base-t full d uplex capability. 0: 10base-t full duplex ability not advertised 1: 10base-t full duplex ability advertised r/w 1b 5 10base-t half duplex this bit determines the advertis ed 10base-t half duplex capability. 0: 10base-t half duplex ability not advertised 1: 10base-t half duplex ability advertised r/w 1b 4:0 selector field this field identifies the type of message being sent by auto-negotiation. 00001: ieee 802.3 r/w 00001b note 13.34 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 222 smsc lan9313/lan9313i datasheet 13.1.7.6 virtual phy auto-negotiation link partner ba se page ability register (vphy_an_lp_base_ability) this read-only register contains the advertised ability of the link partners phy and is used in the auto- negotiation process with the virtual phy. because the virtual phy does not physically connect to an actual link partner, the values in this register are emulated as described below. offset: index (decimal): 1d4h 5 size: 32 bits bits description type default 31:16 reserved (see note 13.35 ) ro - 15 next page this bit indicates the emulated link partner phy next page capability and is always 0. 0: link partner phy does not ad vertise next page capability 1: link partner phy advertises next page capability ro 0b note 13.36 14 acknowledge this bit indicates whether the link code word has been received from the partner and is always 1. 0: link code word not yet received from partner 1: link code word received from partner ro 1b note 13.36 13 remote fault since there is no physical link partner, this bit is not used and is always returned as 0. ro 0b note 13.36 12 reserved ro - 11 asymmetric pause this bit indicates the emulated li nk partner phy asymmetric pause capability. 0: no asymmetric pause toward link partner 1: asymmetric pause toward link partner ro note 13.37 10 pause this bit indicates the emulated link partner phy symmetric pause capability. 0: no symmetric pause toward link partner 1: symmetric pause toward link partner ro note 13.37 9 100base-t4 this bit indicates the emulated link partner phy 100base-t4 capability. this bit is always 0. 0: 100base-t4 ability not supported 1: 100base-t4 ability supported ro 0b note 13.36 8 100base-x full duplex this bit indicates the emulated link partner phy 100base-x full duplex capability. 0: 100base-x full duplex ability not supported 1: 100base-x full duplex ability supported ro note 13.38 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 223 revision 2.0 (02-14-13) datasheet note 13.35 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.36 the emulated link partner does not support next page, always instantly sends its link code word, never sends a fault, an d does not sup port 100base-t4. note 13.37 the emulated link partners asymmetric/symmetric pause ability is based upon the values of the asymmetric pause and pause bits of the virtual phy auto-negotiation advertisement register (vphy_an_adv) . thus the emulated link partner always accommodates the request of the virtual phy, as shown in table 13.5 . see section 7.3.1, "virtual phy auto-negotiation," on page 101 for additional information. note 13.38 the emulated link partners ability is based on the mii_duplex pin, duplex_pol_strap_mii, and speed_strap_mii, as well as on the auto-negotiation success. table 13.6 defines the default capabilities of the emulated link partner as a function of these signals. configuration strap values are latched upon the de-assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . for more information on the virtual phy auto- negotiation, see section 7.3.1, "virtual phy auto-negotiation," on page 101 . 7 100base-x half duplex this bit indicates the emulated link partner phy 100base-x half duplex capability. 0: 100base-x half duplex ability not supported 1: 100base-x half duplex ability supported ro note 13.38 6 10base-t full duplex this bit indicate s the emulated link partner phy 10base-t full duplex capability. 0: 10base-t full duplex ability not supported 1: 10base-t full duplex ability supported ro note 13.38 5 10base-t half duplex this bit indicate s the emulated link partner phy 10base-t half duplex capability. 0: 10base-t half duplex ability not supported 1: 10base-t half duplex ability supported ro note 13.38 4:0 selector field this field identifies the type of message being sent by auto-negotiation. 00001: ieee 802.3 ro 00001b table 13.5 emulated link partner pause flow control ability default values vphy symmetric pause (register 4.10) vphy asymmetric pause (register 4.11) link partner symmetric pause (register 5.10) link partner asymmetric pause (register 5.11) no flow control enabled 0 0 0 0 symmetric pause 1 0 1 0 asymmetric pause towards switch 01 1 1 asymmetric pause towards mac 1 1 0 1 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 224 smsc lan9313/lan9313i datasheet table 13.6 emulated link pa rtner default advertised ability speed_mii advertised link partner ability (bits 8,7,6,5) mii_duplex = duplex_pol_mii 0 10base-t full-duplex (0010) 1 100base-x full-duplex (1000) mii_duplex != duplex_pol_mii 0 10base-t half-duplex (0001) 1 100base-x half-duplex (0100) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 225 revision 2.0 (02-14-13) datasheet 13.1.7.7 virtual phy auto-negotiation expansion register (vphy_an_exp) this register is used in the auto-negotiation process. note 13.39 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.40 since the virtual phy link partner is emulated, there is never a parallel detection fault and this bit is always 0. note 13.41 next page ability is not supported by the virtual phy or emulated link partner. note 13.42 the page received bit is clear when read. it is first cleared on reset, but set shortly thereafter when the auto-negotiation process is run. note 13.43 the emulated link partner will show auto-negotiation able unless auto-negotiation fails (no common bits between the advertised ability and the link partner ability). offset: index (decimal): 1d8h 6 size: 32 bits bits description type default 31:16 reserved (see note 13.39 ) ro - 15:5 reserved ro - 4 parallel detection fault this bit indicates whether a parallel detection fault has been detected. this bit is always 0. 0: a fault hasnt been detected via the parallel detection function 1: a fault has been de tected via the parallel detection function ro 0b note 13.40 3 link partner next page able this bit indicates whether the link partner has next page ability. this bit is always 0. 0: link partner does not c ontain next page capability 1: link partner contains next page capability ro 0b note 13.41 2 local device next page able this bit indicates whether the local device has next page ability. this bit is always 0. 0: local device does not contain next page capability 1: local device contains next page capability ro 0b note 13.41 1 page received this bit indicates the reception of a new page. 0: a new page has not been received 1: a new page has been received ro/lh 1b note 13.42 0 link partner auto -negotiation able this bit indicates the auto-negotiation ability of the link partner. 0: link partner is not auto-negotiation able 1: link partner is auto-negotiation able ro 1b note 13.43 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 226 smsc lan9313/lan9313i datasheet 13.1.7.8 virtual phy special control/status register (v phy_special_control_status) this read/write register contains a current link speed/duplex indicator and sqe cont rol. offset: index (decimal): 1dch31 size: 32 bits bits description type default 31:16 reserved (see note 13.44 ) ro - 15 reserved ro - 14 switch looopback mii when set, transmissions from the switch fabric port 0(external mii) are not sent to the external mii. instead, they are looped back into the switch engine. from the mac viewpoint, this is effectively a far loopback. if loopback is enabled during half-duplex operation, then the enable receive own transmit bit in the port x mac receive configuration register (mac_rx_cfg_x) must be set for this port. otherwise, the switch fabric will ignore receive activity when transmitting in half-duplex mode. this mode works even if the isolate bit of the virtual phy basic control register (vphy_basic_ctrl) is set. r/w 0b 13:8 reserved ro - 7 switch collision test mii when set, the collision signal to the swit ch fabric port 0(external mii) is active during transmission from the switch engine. it is recommended that this bit be used only when using loopback mode. r/w 0b 6:5 reserved ro - 4:2 current speed/duplex indication this field indicates the current speed and duplex of the virtual phy link. ro note 13.45 1 reserved ro - 0 sqeoff this bit enables/disables the sign al quality error (heartbeat) test. 0: sqe test enabled 1: sqe test disabled r/w nasr note 13.46 note 13.47 [4] [3] [2] speed duplex 0 0 0 reserved 0 0 1 10mbps half-duplex 0 1 0 100mbps half-duplex 0 1 1 reserved 1 0 0 reserved 1 0 1 10mbps full-duplex 1 1 0 100mbps full-duplex 1 1 1 reserved downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 227 revision 2.0 (02-14-13) datasheet note 13.44 the reserved bits 31-16 are used to pad the register to 32-bits so that each register is on a dword boundary. when accessed serially (through the mii management protocol), the register is 16-bits wide. note 13.45 the default value of this field is the result of the auto-negotiation process if the auto- negotiation (vphy_an) bit of the virtual phy basic control register (vphy_basic_ctrl) is set. otherwise, this field reflects the speed select lsb (vphy_speed_sel_lsb) and duplex mode (vphy_duplex) bit settings of the vphy_basic_ctrl register. refer to section 7.3.1, "virtual phy auto-negotiation," on page 101 for information on the auto-negotiation determination process of the virtual phy. note 13.46 register bits designated as nasr are reset when the virtual phy reset is generated via the reset control regi ster (reset_ctl) . the nasr designation is only applicable when the reset (vphy_rst) bit of the virtual phy basic control register (vphy_basic_ctrl) is set. note 13.47 the default value of this field is determined via the sqe_test_disable_strap_mii configuration strap. refer to section 4.2.4, "configuration straps," on page 47 for additional information. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 228 smsc lan9313/lan9313i datasheet 13.1.8 miscellaneous this section details the remainder of the system csrs. these registers allow for monitoring and configuration of various lan9313/lan9313i functions such as the chip id/revision, byte order testing, hardware configuration, general purpose timer, and free running counter. 13.1.8.1 chip id and revision (id_rev) this read-only register contains the id and revision fields for the lan9313/lan9313i. note 13.48 default value is dependent on device revision. offset: 050h size: 32 bits bits description type default 31:16 chip id this field indicates the chip id. ro 9313h 15:0 chip revision this field indicates the design revision. ro note 13.48 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 229 revision 2.0 (02-14-13) datasheet 13.1.8.2 byte order test register (byte_test) this read-only register can be used to determine the byte ordering of the current configuration. note: this register can be read while the lan9313/lan9313i is in the not ready state. this register can also be polled while the device is in the reset state without causing any damaging effects. the returned data will be invalid since the serial interfaces are also in the reset state at this time. however, the returned data will not match the normal valid data pattern during reset. note: in smi mode, either half of this register can be read without the need to read the other half. offset: 064h size: 32 bits bits description type default 31:0 byte test (byte_test) this field reflects the current byte ordering ro 87654321h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 230 smsc lan9313/lan9313i datasheet 13.1.8.3 hardware configuration register (hw_cfg) this register allows the configuration of various hardware features. note: this register can be polled while the lan9313/lan9313i is in the reset or not ready state (ready bit is cleared). returned data will be invalid during the reset state since the serial interfaces are also in reset at this time. note: in smi mode, either half of this register can be read without the need to read the other half. note 13.49 the default value of this field is determined by the configuration strap auto_mdix_strap_2. see section 4.2.4, "configuration straps," on page 47 for more information. note 13.50 the default value of this field is determined by the configuration strap auto_mdix_strap_1. see section 4.2.4, "configuration straps," on page 47 for more information. offset: 074h size: 32 bits bits description type default 31:28 reserved ro - 27 device ready (ready) when set, this bit indicates that the lan9313/lan9313i is ready to be accessed. upon power-up, nrst reset, or digital reset, the host processor may interrogate this field as an indication that the lan9313/lan9313i has stabilized and is fully active. this bit can cause an interrupt if enabled. note: with the exception of the hw_cfg, byte_test, and reset_ctl registers, read access to any internal resources is forbidden while the ready bit is cleared. writes to any address are invalid until this bit is set. ro 0b 26 amdix_en strap state port 2 this bit reflects the state of the auto_mdix_strap_2 strap that connects to the phy. the strap value is loaded with the level of the auto_mdix_strap_2 during reset and can be re -written by the eeprom loader. the strap value can be overridden by bit 15 and 13 of the port 2 phy special control/status indication register ( section 13.2.2.10 ). ro note 13.49 25 amdix_en strap state port 1 this bit reflects the state of the auto_mdix_strap_1 strap that connects to the phy. the strap value is loaded with the level of the auto_mdix_strap_1 during reset and can be re -written by the eeprom loader. the strap value can be overridden by bit 15 and 13 of the port 1 phy special control/status indication register ( section 13.2.2.10 ). ro note 13.50 24:0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 231 revision 2.0 (02-14-13) datasheet 13.1.8.4 general purpose timer configuration register (gpt_cfg) this read/write register configures the lan931 3/lan9313i general purpose timer (gpt). the gpt can be configured to generate host interrupts at the interval defined in this register. the current value of the gpt can be monitored via the general purpose timer count register (gpt_cnt) . refer to section 11.1, "general purpose timer," on page 145 for additional information. offset: 08ch size: 32 bits bits description type default 31:30 reserved ro - 29 general purpose timer enable (timer_en) this bit enables the gpt. when set, the gpt enters the run state. when cleared, the gpt is halted. on the 1 to 0 transition of this bit, the gpt_load field of this register will be preset to ffffh. 0: gpt disabled 1: gpt enabled r/w 0b 28:16 reserved ro - 15:0 general purpose timer pre-load (gpt_load) this value is pre-loaded into the gpt. this is the starting value of the gpt. the timer will begin decrementing from this value when enabled. r/w ffffh downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 232 smsc lan9313/lan9313i datasheet 13.1.8.5 general purpose timer count register (gpt_cnt) this read-only register reflects the current general purpose timer (gpt) value. the register should be used in conjunction with the general purpose timer configuration register (gpt_cfg) to configure and monitor the gpt. refer to section 11.1, "general purpose timer," on page 145 for additional information. offset: 090h size: 32 bits bits description type default 31:16 reserved ro - 15:0 general purpose timer current count (gpt_cnt) this 16-bit field represents the current value of the gpt. ro ffffh downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 233 revision 2.0 (02-14-13) datasheet 13.1.8.6 free running 25mhz counter register (free_run) this read-only register reflects the current value of the free-running 25mhz counter. refer to section 11.2, "free-running clock," on page 145 for additional information. offset: 09ch size: 32 bits bits description type default 31:0 free running counter (fr_cnt) this field reflects the current value of the free-running 32-bit counter. at reset, the counter starts at zero and is incremented by one every 25mhz cycle. when the maximum count has been reached, the counter will rollover to zero and continue counting. note: the free running counter can take up to 160ns to clear after a reset event. ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 234 smsc lan9313/lan9313i datasheet 13.1.8.7 reset control register (reset_ctl) this register contains so ftware controlled resets. note: this register can be read while the lan9313/lan9313i is in the not ready state. this register can also be polled while the device is in the reset state without causing any damaging effects. however, the returned data will be invalid since the serial interfaces are also in the reset state at this time. note: in smi mode, either half of this register can be read without the need to read the other half. offset: 1f8h size: 32 bits bits description type default 31:4 reserved ro - 3 virtual phy reset (vphy_rst) setting this bit resets the virtual phy. when the virtual phy is released from reset, this bit is automatically cleared. all writes to this bit are ignored while this bit is set. note: this bit is not accessible via the eeprom loader. r/w sc 0b 2 port 2 phy reset (phy2_rst) setting this bit resets the port 2 phy. the internal logic automatically holds the phy reset for a minimum of 102us. when the port 2 phy is released from reset, this bit is automatically cleared. all writes to this bit are ignored while this bit is set. note: this bit is not accessible via the eeprom loader. r/w sc 0b 1 port 1 phy reset (phy1_rst) setting this bit resets the port 1 phy. the internal logic automatically holds the phy reset for a minimum of 102us. when the port 1 phy is released from reset, this bit is automatically cleared. all writes to this bit are ignored while this bit is set. note: this bit is not accessible via the eeprom loader. r/w sc 0b 0 digital reset (digital_rst) setting this bit resets the complete chip except the pll, virtual phy, port 1 phy, and port 2 phy. the eeprom loa der will automatica lly reload the configuration following this reset, but will not reset the virtual phy, port 1 phy, or port 2 phy. if desired, the above phy resets can be issued once the device is configured. all system csrs are reset exce pt for any nasr type bits. any in progress eeprom commands (including reload) are terminated. when the chip is released from reset, this bit is automatically cleared. the byte_test register should be polled to determine when the reset is complete. all writes to this bit are ignored while this bit is set. note: this bit is not accessible via the eeprom loader. r/w sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 235 revision 2.0 (02-14-13) datasheet 13.2 ethernet phy cont rol and status registers this section details the various lan9313/lan9313i ethernet phy control and status registers. the lan9313/lan9313i contains three phys: port 1 phy, port 2 phy and a virtual phy. all phy registers follow the ieee 802.3 (claus e 22.2.4) specified mii m anagement register set. all functionality and bit definitions comply with these standards. the ieee 802.3 specified register index (in decimal) is included with each register definition, allowing for addressing of these registers via the mii serial management protocol. for additional information on the mii management protocol, refer to the ieee 802.3 specification. each individual phy is assigned a unique phy address as detailed in section 7.1.1, "phy addressing," on page 87 . 13.2.1 virtual phy registers the virtual phy provides a basic mii management interface for communication with an standard external mac as if it was attached to a single por t phy. the virtual phy registers differ from the port 1 & 2 phy registers in that they are addressable via the memory map, as described in table 13.1 , as well as serially. these modes of access are described in section 13.1.7, "virtual phy," on page 213 . because the virtual phy registers are also memory mapped, their definitions have been included in the system control and status registers section 13.1.7, "virtual phy," on page 213 . a list of the virtual phy mii addressable registers and their corresponding register i ndex numbers is also included in ta b l e 1 3 . 4 . note: when serially accessed, the virt ual phy registers are only 16-bits wide, as is standard for mii management of phys. 13.2.2 port 1 & 2 phy registers the port 1 and port 2 phys are comparable in functionality and have an identical set of non-memory mapped registers. the port 1 and port 2 phy regi sters are not memory mapped. these registers are indirectly accessed through the phy management interface access register (pmi_access) and phy management interface data register (pmi_data) registers (in mac or phy i 2 c and spi managed modes only) or through the mii management pins (in mac or phy smi managed modes only) via the mii serial management protocol specif ied in ieee 802.3 clause 22. see section 2.3, "modes of operation," on page 24 for a details on the various lan9313/lan9313i modes. because the port 1 & 2 phy registers are functionally identical, their register descriptions have been consolidated. a lowercase x has been appended to the end of each phy register name in this section, where x should be replaced with 1 or 2 for the port 1 phy or the port 2 phy registers respectively. a list of the port 1 & 2 phy mii addressable registers and their corresponding register index numbers is included in ta b l e 1 3 . 7 . each individual phy is assigned a unique phy address as detailed in section 7.1.1, "phy addressing," on page 87 . table 13.7 port 1 & 2 phy mii serially adressable registers index # symbol register name 0 phy_basic_control_x port x phy basic control register, section 13.2.2.1 1 phy_basic_status_x port x phy basic status register, section 13.2.2.2 2 phy_id_msb_x port x phy identification msb register, section 13.2.2.3 3 phy_id_lsb_x port x phy identification lsb register, section 13.2.2.4 4 phy_an_adv_x port x phy auto-neg otiation advertisement register, section 13.2.2.5 5 phy_an_lp_base_ability_x port x phy auto-negotiation link partner base page ability register, section 13.2.2.6 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 236 smsc lan9313/lan9313i datasheet 6 phy_an_exp_x port x phy auto-neg otiation expansion register, section 13.2.2.7 17 phy_mode_control_status_x port x phy mode control/status register, section 13.2.2.8 18 phy_special_modes_x port x phy special modes register, section 13.2.2.9 27 phy_special_control_stat_ind_x port x phy special control/status indication register, section 13.2.2.10 29 phy_interrupt_source_x port x phy interrupt source flags register, section 13.2.2.11 30 phy_interrupt_mask_x port x phy interrupt mask register, section 13.2.2.12 31 phy_special_control_status_x port x phy special control/status register, section 13.2.2.13 table 13.7 port 1 & 2 phy mii serial ly adressable registers (continued) index # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 237 revision 2.0 (02-14-13) datasheet 13.2.2.1 port x phy basic contro l register (phy_basic_control_x) this read/write register is used to configure the port x phy. note: this register is re-written in its entirety by the eeprom loader following the release of reset or a reload command. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. index (decimal): 0 size: 16 bits bits description type default 15 reset (phy_rst) when set, this bit resets all the port x phy registers to their default state, except those marked as nasr type. this bit is self clearing. 0: normal operation 1: reset r/w sc 0b 14 loopback (phy_loopback) this bit enables/disables the loopback mode. when enabled, transmissions from the switch fabric are not sent to network. instead, they are looped back into the switch fabric. note: if loopback is enabled during half-duplex operation, then the enable receive own transmit bit in the port x mac receive configuration register (mac_rx_cfg_x) must be set for the specified port. otherwise, the switch fabric will ignore receive activity when transmitting in half-duplex mode. 0: loopback mode disabled (normal operation) 1: loopback mode enabled r/w 0b 13 speed select lsb (phy_speed_sel_lsb) this bit is used to set the speed of the port x phy when the auto- negotiation (phy_an) bit is disabled. 0: 10 mbps 1: 100 mbps r/w note 13.51 12 auto-negotiation (phy_an) this bit enables/disables auto-negotiation. when enabled, the speed select lsb (phy_speed_sel_lsb) and duplex mode (phy_duplex) bits are overridden. 0: auto-negotiation disabled 1: auto-negotiation enabled r/w note 13.52 11 power down (phy_pwr_dwn) this bit controls the power down mode of the port x phy. after this bit is cleared the phy may auto-negotiate with its partner station. this process can take up to a few seconds to complete. once auto-negotiation is complete, bit 5 ( auto-negotiation complete ) of the port x phy basic status register (phy_basic_status_x) will be set. note: the phy_an bit of this register must be cleared before setting this bit. 0: normal operation 1: general power down mode r/w 0b 10 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 238 smsc lan9313/lan9313i datasheet note 13.51 the default value of this bit is determined by the logical or of the auto-negotiation strap (autoneg_strap_1 for port 1 phy, autoneg_strap_2 for port 2 phy) and the speed select strap (speed_strap_1 for port 1 phy, speed_strap_2 for port 2 phy). essentially, if the auto-negotiation strap is set, the default value is 1, otherwise the default is determined by the value of the speed se lect strap. refer to section 4.2.4, "configuration straps," on page 47 for more information. note 13.52 the default value of this bit is determined by the value of the auto-negotiation strap (autoneg_strap_1 for port 1 phy, autoneg_strap_2 for port 2 phy). refer to section 4.2.4, "configuration straps," on page 47 for more information. note 13.53 the default value of this bit is determined by the logical and of the negation of the auto- negotiation strap (autoneg_strap_1 for port 1 phy, autoneg_strap_2 for port 2 phy) and the duplex select strap (duplex_strap_1 for port 1 phy, duplex_strap_2 for port 2 phy). essentially, if the auto-negotiation strap is set, the default value is 0, otherwise the default is determined by the value of the duplex select strap. refer to section 4.2.4, "configuration straps," on page 47 for more information. 9 restart auto-negotiation (phy_rst_an) when set, this bit restarts the auto-negotiation process. 0: normal operation 1: auto-negotiation restarted r/w sc 0b 8 duplex mode (phy_duplex) this bit is used to set the duplex when the auto-negotiation (phy_an) bit is disabled. 0: half duplex 1: full duplex r/w note 13.53 7 collision test mode (phy_col_test) this bit enables/disables the collision test mode of the port x phy. when set, the collision signal is active during transmission. it is recommended that this feature be used only in loopback mode. 0: collision test mode disabled 1: collision test mode enabled r/w 0b 6:0 reserved ro - bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 239 revision 2.0 (02-14-13) datasheet 13.2.2.2 port x phy basic status register (phy_basic_status_x) this register is used to monitor the status of the port x phy. index (decimal): 1 size: 16 bits bits description type default 15 100base-t4 this bit displays the status of 100base-t4 compatibility. 0: phy not able to perform 100base-t4 1: phy able to perform 100base-t4 ro 0b note 13.54 14 100base-x full duplex this bit displays the status of 100base-x full duplex compatibility. 0: phy not able to perf orm 100base-x full duplex 1: phy able to perfor m 100base-x full duplex ro 1b 13 100base-x half duplex this bit displays the status of 100base-x half duplex compatibility. 0: phy not able to perf orm 100base-x half duplex 1: phy able to perfor m 100base-x half duplex ro 1b 12 10base-t full duplex this bit displays the status of 10base-t full duplex compatibility. 0: phy not able to perf orm 10base-t full duplex 1: phy able to perfor m 10base-t full duplex ro 1b 11 10base-t half duplex this bit displays the status of 10base-t half duplex compatibility. 0: phy not able to perform 10base-t half duplex 1: phy able to perform 10base-t half duplex ro 1b 10 100base-t2 full duplex this bit displays the status of 100base-t2 full duplex compatibility. 0: phy not able to perform 100base-t2 full duplex 1: phy able to perform 100base-t2 full duplex ro 0b note 13.54 9 100base-t2 half duplex this bit displays the status of 100base-t2 half duplex compatibility. 0: phy not able to perform 100base-t2 half duplex 1: phy able to perform 100base-t2 half duplex ro 0b note 13.54 8:6 reserved ro - 5 auto-negotiation complete this bit indicates the status of the auto-negotiation process. 0: auto-negotiation process not completed 1: auto-negotiation process completed ro 0b 4 remote fault this bit indicates if a remote fault condition has been detected. 0: no remote fault condition detected 1: remote fault condition detected ro/lh 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 240 smsc lan9313/lan9313i datasheet note 13.54 the phy supports 100base-tx (half and full duplex) and 10base-t (half and full duplex) only. all other modes will always return as 0 (unable to perform). 3 auto-negotiation ability this bit indicates the status of the phys auto-negotiation. 0: phy is unable to perform auto-negotiation 1: phy is able to perform auto-negotiation ro 1b 2 link status this bit indicates the status of the link. 0: link is down 1: link is up ro/ll 0b 1 jabber detect this bit indicates the status of the jabber condition. 0: no jabber co ndition detected 1: jabber condition detected ro/lh 0b 0 extended capability this bit indicates whether extended register capability is supported. 0: basic register set capabilities only 1: extended register set capabilities ro 1b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 241 revision 2.0 (02-14-13) datasheet 13.2.2.3 port x phy identification msb register (phy_id_msb_x) this read/write register contains the msb of the organizationally unique identifier (oui) for the port x phy. the lsb of the phy oui is contained in the port x phy identification lsb register (phy_id_lsb_x) . index (decimal): 2 size: 16 bits bits description type default 15:0 phy id this field is assigned to the 3rd through 18th bits of the oui, respectively (oui = 00800fh). r/w 0007h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 242 smsc lan9313/lan9313i datasheet 13.2.2.4 port x phy identification lsb register (phy_id_lsb_x) this read/write register contains the lsb of the or ganizationally unique ident ifier (oui) for the port x phy. the msb of the phy oui is contained in the port x phy identification msb register (phy_id_msb_x) . index (decimal): 3 size: 16 bits bits description type default 15:10 phy id this field is assigned to the 19th through 24th bits of the phy oui, respectively. (oui = 00800fh). r/w 110000b 9:4 model number this field contains the 6-bit manufacturers model number of the phy. r/w 001101b 3:0 revision number this field contain the 4-bit manufacturers revision number of the phy. r/w 0001b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 243 revision 2.0 (02-14-13) datasheet 13.2.2.5 port x phy auto-negotiation advertisement register (phy_an_adv_x) this read/write register contains the advertised ability of the port x phy and is used in the auto- negotiation process with the link partner. note: this register is re-written by the eeprom loader following the release of reset or a reload command. refer to section 8.2.4, "eeprom loader," on page 117 for additional information. index (decimal): 4 size: 16 bits bits description type default 15:14 reserved ro - 13 remote fault this bit determines if remote fault indication will be advertised to the link partner. 0: remote fault indication not advertised 1: remote fault indication advertised r/w 0b 12 reserved note: this bit should be written as 0. r/w 0b 11 asymmetric pause this bit determines the advertised asymmetric pause capability. 0: no asymmetric pause towa rd link partner advertised 1: asymmetric pause toward link partner advertised r/w 0b note 13.55 10 symmetric pause this bit determines the advertised symmetric pause capability. 0: no symmetric pause towa rd link partner advertised 1: symmetric pause toward link partner advertised r/w note 13.55 note 13.56 9 reserved ro - 8 100base-x full duplex this bit determines the advertised 100base-x full duplex capability. 0: 100base-x full duplex ability not advertised 1: 100base-x full duplex ability advertised r/w 1b 7 100base-x half duplex this bit determines the advertised 100base-x half duplex capability. 0: 100base-x half duplex ability not advertised 1: 100base-x half duplex ability advertised r/w 1b 6 10base-t full duplex this bit determines the advertis ed 10base-t full d uplex capability. 0: 10base-t full duplex ability not advertised 1: 10base-t full duplex ability advertised r/w note 13.57 table 13.8 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 244 smsc lan9313/lan9313i datasheet note 13.55 the pause and asymmetric pause bits are loaded into the phy registers by the eeprom loader. note 13.56 the default value of this bit is determined by the manual flow control enable strap (manual_fc_strap_x). when the manual flow control enable strap is 0, this bit defaults to 1 (symmetric pause advertised). when the manual flow control enable strap is 1, this bit defaults to 0 (symmetric pause not advertised). configuration strap values are latched upon the de-assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . refer to section 4.2.4, "configuration straps," on page 47 for configuration strap definitions. note 13.57 the default value of this bit is determined by the logical or of the auto-negotiation strap (autoneg_strap_x) with the logical and of the negated speed select strap (speed_strap_x) and (duplex_strap_x). table 13.8 defines the default behavior of this bit. configuration strap values are latched upon the de-assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . refer to section 4.2.4, "configuration straps," on page 47 for configuration strap definitions. note 13.58 the default value of this bit is determined by the logical or of the auto-negotiation strap (autoneg_strap_x) and the negated speed strap (speed_strap_x). table 13.9 defines the default behavior of this bit. configuration strap values are latched upon the de-assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . refer to section 4.2.4, "configuration straps," on page 47 for configuration strap definitions. 5 10base-t half duplex this bit determines the advertis ed 10base-t half duplex capability. 0: 10base-t half duplex ability not advertised 1: 10base-t half duplex ability advertised r/w note 13.58 table 13.9 4:0 selector field this field identifies the type of message being sent by auto-negotiation. 00001: ieee 802.3 r/w 00001b table 13.8 10base-t full duplex advertisement default value autoneg_strap_x speed_strap_x duplex_strap_x def ault 10base-t full duplex (bit 6) value 000 0 001 1 010 0 011 0 100 1 101 1 110 1 111 1 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 245 revision 2.0 (02-14-13) datasheet table 13.9 10base-t half duplex advertisement bit default value autoneg_strap_x speed_strap_x default 10base-t half duplex (bit 5) value 00 1 01 0 10 1 11 1 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 246 smsc lan9313/lan9313i datasheet 13.2.2.6 port x phy auto-negotiation link partner base page ability register (phy_an_lp_base_ability_x) this read-only register contains the advertised ability of the link partners phy and is used in the auto- negotiation process between the link partner and the port x phy. index (decimal): 5 size: 16 bits bits description type default 15 next page this bit indicates the link partner phy page capability. 0: link partner phy does not ad vertise next page capability 1: link partner phy advertises next page capability ro 0b 14 acknowledge this bit indicates whether the link code word has been received from the partner. 0: link code word not yet received from partner 1: link code word received from partner ro 0b 13 remote fault this bit indicates whether a remote fault has been detected. 0: no remote fault 1: remote fault detected ro 0b 12 reserved ro - 11 asymmetric pause this bit indicates the link partner phy asymmetric pause capability. 0: no asymmetric pause toward link partner 1: asymmetric pause toward link partner ro 0b 10 pause this bit indicates the link partner phy symmetric pause capability. 0: no symmetric pause toward link partner 1: symmetric pause toward link partner ro 0b 9 100base-t4 this bit indicates th e link partner phy 100base-t4 capability. 0: 100base-t4 ability not supported 1: 100base-t4 ability supported ro 0b 8 100base-x full duplex this bit indicate s the link partner phy 100base-x full duplex capability. 0: 100base-x full duplex ability not supported 1: 100base-x full duplex ability supported ro 0b 7 100base-x half duplex this bit indicates the link partner phy 100base-x half duplex capability. 0: 100base-x half duplex ability not supported 1: 100base-x half duplex ability supported ro 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 247 revision 2.0 (02-14-13) datasheet note 13.59 the port 1 & 2 phys support only ieee 802.3. 6 10base-t full duplex this bit indicate s the link partner phy 10base-t full duplex capability. 0: 10base-t full duplex ability not supported 1: 10base-t full duplex ability supported ro 0b 5 10base-t half duplex this bit indicate s the link partner phy 10base- t half duplex capability. 0: 10base-t half duplex ability not supported 1: 10base-t half duplex ability supported ro 0b 4:0 selector field this field identifies the type of message being sent by auto-negotiation. 00001: ieee 802.3 ro 00001b note 13.59 bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 248 smsc lan9313/lan9313i datasheet 13.2.2.7 port x phy auto-negotiation expansion register (phy_an_exp_x) this read/write register is used in the auto-negotiation process between the link partner and the port x phy. index (decimal): 6 size: 16 bits bits description type default 15:5 reserved ro - 4 parallel detection fault this bit indicates whether a parallel detection fault has been detected. 0: a fault hasnt been detected via the parallel detection function 1: a fault has been de tected via the parallel detection function ro/lh 0b 3 link partner next page able this bit indicates whether the link partner has next page ability. 0: link partner does not c ontain next page capability 1: link partner contains next page capability ro 0b 2 local device next page able this bit indicates whether the local device has next page ability. 0: local device does not contain next page capability 1: local device contains next page capability ro 0b 1 page received this bit indicates the reception of a new page. 0: a new page has not been received 1: a new page has been received ro/lh 0b 0 link partner auto -negotiation able this bit indicates the auto-negotiation ability of the link partner. 0: link partner is not auto-negotiation able 1: link partner is auto-negotiation able ro 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 249 revision 2.0 (02-14-13) datasheet 13.2.2.8 port x phy mode control/status register (phy_mode_control_status_x) this read/write register is used to control and monitor various port x phy configuration options. index (decimal): 17 size: 16 bits bits description type default 15:14 reserved ro - 13 energy detect power-down (edpwrdown) this bit controls the energy detect power-down mode. 0: energy detect power-down is disabled 1: energy detect power-down is enabled r/w 0b 12:2 reserved ro - 1 energy on (energyon) this bit indicates whether energy is detected on the line. it is cleared if no valid energy is detected within 256ms. this bit is unaffected by a software reset and is reset to 1 by a hardware reset. 0: no valid energy detected on the line 1: energy detected on the line ro 1b 0 reserved r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 250 smsc lan9313/lan9313i datasheet 13.2.2.9 port x phy special mode s register (phy_special_modes_x) this read/write register is used to control the special modes of the port x phy. note: this register is re-written by the eeprom loader following the release of reset or a reload command. refer to section 8.2.4, "eeprom loader," on page 117 for more information. note 13.60 register bits designated as nasr are reset when the port x phy reset is generated via the reset control regi ster (reset_ctl) . the nasr designation is only applicable when the reset (phy_rst) bit of the port x phy basic control register (phy_basic_control_x) is set. note 13.61 the default value of this field is determined by a combination of the configuration straps autoneg_strap_x, speed_strap_x, and duplex_strap_x. if the autoneg_strap_x is 1, then the default mode[2:0] value is 111b. else, the default value of this field is determined by the remaining straps. mode[2]=0, mode[1]=(speed_strap_1 for port 1 phy, speed_strap_2 for port 2 phy), and mode[0]=(duplex_strap_1 for port 1 phy, duplex_strap_2 for port 2 phy). configuration strap values are latched upon the de- assertion of a chip-level reset as described in section 4.2.4, "configuration straps," on page 47 . refer to section 4.2.4, "configuration straps," on page 47 for configuration strap definitions. note 13.62 the default value of this field is determined by the phy_addr_sel_strap configuration strap. refer to section 7.1.1, "phy addressing," on page 87 for additional information. index (decimal): 18 size: 16 bits bits description type default 15:8 reserved ro - 7:5 phy mode (mode[2:0]) this field controls the phy mode of operation. refer to table 13.10 for a definition of each mode. r/w nasr note 13.60 note 13.61 4:0 phy address (phyadd) the phy address field determines the mmi address to which the phy will respond and is also used for initialization of the cipher (scrambler) key. each phy must have a unique address. refer to section 7.1.1, "phy addressing," on page 87 for additional information. note: no check is performed to ensure that this address is unique from the other phy addresses (port 1 phy, port 2 phy, and virtual phy). r/w nasr note 13.60 note 13.62 table 13.10 mode [2:0] definitions mode[2:0] mode definitions affected register bit values phy_basic_control_x phy_an_adv_x [13,12,10,8] [8,7,6,5] 000 10base-t half duplex. auto-negotiation disabled. 0000 n/a 001 10base-t full duplex. auto-negotiation disabled. 0001 n/a 010 100base-tx half dupl ex. auto-negotiation disabled. crs is active during transmit & receive. 1000 n/a downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 251 revision 2.0 (02-14-13) datasheet 011 100base-tx full dupl ex. auto-negotiation disabled. crs is active during receive. 1001 n/a 100 100base-tx half duplex is advertised. auto- negotiation enabled. crs is active during transmit & receive. 1100 0100 101 repeater mode. auto-negotiation enabled. 100base-tx half duplex is advertised. crs is active during receive. 1100 0100 110 power down mode. in this mode the phy wake-up in power-down mode. n/a n/a 111 all capable. auto-negotiation enabled. x10x 1111 table 13.10 mode[2:0] definitions (continued) mode[2:0] mode definitions affected register bit values phy_basic_control_x phy_an_adv_x [13,12,10,8] [8,7,6,5] downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 252 smsc lan9313/lan9313i datasheet 13.2.2.10 port x phy speci al control/status indi cation register (phy_ special_control_stat_ind_x) this read/write register is used to control various options of the port x phy. note 13.63 register bits designated as nasr are reset when the port x phy reset is generated via the reset control regi ster (reset_ctl) . the nasr designation is only applicable when the reset (phy_rst) bit of the port x phy basic control register (phy_basic_control_x) is set. index (decimal): 27 size: 16 bits bits description type default 15 auto-mdix control (amdixctrl) this bit is responsible for determining the source of auto-mdix control for port x. when set, the manual mdix and auto mdix straps (manual_mdix_strap_1/auto_mdix_strap_1 for port 1 phy, manual_mdix_strap_2/auto_mdix_strap_2 for port 2 phy) are overridden, and auto-mdix functions are controlled using bit 14 (amdixen) and bit 13 (amdixstate) of this register. when cleared, auto-mdix functionality is controlled by the manual mdix and auto mdix straps by default. refer to section 4.2.4, "configuration straps," on page 47 for configuration strap definitions. 0: port x auto-mdix determined by strap inputs 1: port x auto-mdix determined by bits 14 and 13 r/w nasr note 13.63 0b 14 auto-mdix enable (amdixen) when bit 15 (amdixctrl) of this register is set, this bit is used in conjunction with bit 13 (auto-mdix state) to control the port x auto-mdix functionality as shown in table 13.11 . r/w nasr note 13.63 0b 13 auto-mdix state (amdixstate) when bit 15 (amdixctrl) of this register is set, this bit is used in conjunction with bit 14 (auto-mdix enable) to control the port x auto-mdix functionality as shown in table 13.11 . r/w nasr note 13.63 0b 12 reserved ro - 11 sqe test disable (sqeoff) this bit controls the disabling of the sqe test (heartbeat). sqe test is enabled by default. 0: sqe test enabled 1: sqe test disabled r/w nasr note 13.63 0b 10 receive pll lock control (vcooff_lp) this bit controls the locking of the receive pll. setting this bit to 1 forces the receive pll 10m to lock on the reference clock at all times. when in this mode, 10m data packets cannot be received. 0: receive pll 10m can lock on reference or line as needed (normal operation) 1: receive pll 10m locked onto reference clock at all times r/w nasr note 13.63 0b 9:5 reserved ro - 4 10base-t polarity state (xpol) this bit shows the polarity state of the 10base-t. 0: normal polarity 1: reversed polarity ro 0b 3:0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 253 revision 2.0 (02-14-13) datasheet table 13.11 auto-mdix enable and auto-mdix state bit functionality auto-mdix enable (bit 14) auto-mdix state (bit 13) mode 0 0 manual mode, no crossover 0 1 manual mode, crossover 1 0 auto-mdix mode 1 1 reserved (do not use this state) downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 254 smsc lan9313/lan9313i datasheet 13.2.2.11 port x phy interrupt source flags register (phy_interrupt_source_x) this read-only register is used to determine to so urce of various port x phy interrupts. all interrupt source bits in this register are read-only and latch high upon detection of the corresponding interrupt (if enabled). a read of this register clears the interrupts. these interrupts are enabled or masked via the port x phy interrupt mask re gister (phy_interrupt_mask_x) . index (decimal): 29 size: 16 bits bits description type default 15:8 reserved ro - 7 int7 this interrupt source bit indicates when the energyon bit of the port x phy mode control/status register (phy_mode_control_status_x) has been set. 0: not source of interrupt 1: energyon generated ro/lh 0b 6 int6 this interrupt source bit indicates auto-negotiation is complete. 0: not source of interrupt 1: auto-negotiation complete ro/lh 0b 5 int5 this interrupt source bit indicates a remote fault has been detected. 0: not source of interrupt 1: remote fault detected ro/lh 0b 4 int4 this interrupt source bit indicates a link down (link status negated). 0: not source of interrupt 1: link down (link status negated) ro/lh 0b 3 int3 this interrupt source bit indicates an auto-negotiation lp acknowledge. 0: not source of interrupt 1: auto-negotiation lp acknowledge ro/lh 0b 2 int2 this interrupt source bit indicates a parallel detection fault. 0: not source of interrupt 1: parallel detection fault ro/lh 0b 1 int1 this interrupt source bit indicates an auto-negotiation page received. 0: not source of interrupt 1: auto-negotiation page received ro/lh 0b 0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 255 revision 2.0 (02-14-13) datasheet 13.2.2.12 port x phy interrupt mask register (phy_interrupt_mask_x) this read/write register is used to enable or mask the various port x phy interrupts and is used in conjunction with the port x phy interrupt source flags register (phy_interrupt_source_x) . index (decimal): 30 size: 16 bits bits description type default 15:8 reserved ro - 7 int7_mask this interrupt mask bit enables /masks the energyon interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 6 int6_mask this interrupt mask bit enables/ma sks the auto-negotiation interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 5 int5_mask this interrupt mask bit enables/m asks the remote fault interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 4 int4_mask this interrupt mask bit enables/masks th e link down (link status negated) interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 3 int3_mask this interrupt mask bit enables/masks the auto-negotiation lp acknowledge interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 2 int2_mask this interrupt mask bit enables/masks th e parallel detectio n fault interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 1 int1_mask this interrupt mask bit enables/masks the auto-negotiation page received interrupt. 0: interrupt source is masked 1: interrupt source is enabled r/w 0b 0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 256 smsc lan9313/lan9313i datasheet 13.2.2.13 port x phy special control/status register (p hy_special_control_status_x) this read/write register is used to control and monitor various options of the port x phy. index (decimal): 31 size: 16 bits bits description type default 15:13 reserved ro - 12 autodone this bit indicates the status of the auto-negotiation on the port x phy. 0: auto-negotiation is not completed, is disabled, or is not active 1: auto-negotiation is completed ro 0b 11:5 reserved - write as 00 00010b, ignore on read r/w 0000010b 4:2 speed indication this field indicates the current port x phy speed configuration. ro 000b 1:0 reserved r/w 0b state description 000 reserved 001 10base-t half-duplex 010 100base-tx half-duplex 011 reserved 100 reserved 101 10base-t full-duplex 110 100base-tx full-duplex 111 reserved downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 257 revision 2.0 (02-14-13) datasheet 13.3 switch fabric cont rol and status registers this section details the various lan9313/lan9313i switch control and status registers that reside within the switch fabric. the switch control and status registers allow configuration of each individual switch port, the switch engine, and buffer manager. switch fabric related interrupts and resets are also controlled and monitored via the switch csrs. the switch csrs are not memory mapped. all switch csrs are accessed indirectly via the switch fabric csr interface command register (switch_csr_cmd) , switch fabric csr interface data register (switch_csr_data) , and switch fabric csr interface direct data register (switch_csr_direct_data) in the system csr memory mapp ed address space. all accesses to the switch csrs must be performed through these registers. refer to section 13.1.5, "switch fabric" for additional information. note: the flow control settings of the switch ports are configured via the switch fabric registers: port 1 manual flow control register (manual_fc_1) , port 2 manual flow control register (manual_fc_2) , and port 0(external mii) manual flow control register (manual_fc_mii) located in th e system csr address space. table 13.12 lists the switch csrs and their correspo nding addresses in order. the switch fabric registers can be categorized in to the following sub-sections: ? section 13.3.1, "general switch csrs," on page 268 ? section 13.3.2, "switch port 0, port 1, and port 2 csrs," on page 272 ? section 13.3.3, "switch engine csrs," on page 316 ? section 13.3.4, "buffer manager csrs," on page 361 table 13.12 indirectly accessible switch control and status registers register # symbol register name general switch csrs 0000h sw_dev_id switch device id register, section 13.3.1.1 0001h sw_reset switch reset register, section 13.3.1.2 0002h-0003h reserved reserved for future use 0004h sw_imr switch global interrupt mask register, section 13.3.1.3 0005h sw_ipr switch global interrupt pending register, section 13.3.1.4 0006h-03ffh reserved rese rved for future use switch port 0 csrs 0400h mac_ver_id_mii port 0 mac version id register, section 13.3.2.1 0401h mac_rx_cfg_mii port 0 mac receive configuration register, section 13.3.2.2 0402h-040fh reserved rese rved for future use 0410h mac_rx_undsze_cnt_mii port 0 mac receive undersize count register, section 13.3.2.3 0411h mac_rx_64_cnt_mii port 0 mac receive 64 byte count register, section 13.3.2.4 0412h mac_rx_65_to_127_cnt_mii port 0 mac receive 65 to 127 byte count register, section 13.3.2.5 0413h mac_rx_128_to_255_cnt_mii port 0 mac receive 128 to 255 byte count register, section 13.3.2.6 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 258 smsc lan9313/lan9313i datasheet 0414h mac_rx_256_to_511_cnt_mii port 0 mac receive 256 to 511 byte count register, section 13.3.2.7 0415h mac_rx_512_to_1023_cnt_mii port 0 mac receive 512 to 1023 byte count register, section 13.3.2.8 0416h mac_rx_1024_to_max_cnt_mii port 0 mac receive 1024 to max byte count register, section 13.3.2.9 0417h mac_rx_ovrsze_cnt_mii port 0 mac receive oversize count register, section 13.3.2.10 0418h mac_rx_pktok_cnt_mii port 0 mac receive ok count register, section 13.3.2.11 0419h mac_rx_crcerr_cnt_mii port 0 mac receive crc error count register, section 13.3.2.12 041ah mac_rx_mulcst_cnt_mii port 0 mac receive multicast count register, section 13.3.2.13 041bh mac_rx_brdcst_cnt_mii port 0 mac receive broadcast count register, section 13.3.2.14 041ch mac_rx_pause_cnt_mii port 0 mac receive pause frame count register, section 13.3.2.15 041dh mac_rx_frag_cnt_mii port 0 mac receive fragment error count register, section 13.3.2.16 041eh mac_rx_jabb_cnt_mii port 0 mac re ceive jabber error count register, section 13.3.2.17 041fh mac_rx_align_cnt_mii port 0 mac receive alignment error count register, section 13.3.2.18 0420h mac_rx_pktlen_cnt_mii port 0 mac receive packet length count register, section 13.3.2.19 0421h mac_rx_goodpktlen_cnt_mii port 0 mac receive good packet length count register, section 13.3.2.20 0422h mac_rx_symbl_cnt_mii port 0 mac re ceive symbol error count register, section 13.3.2.21 0423h mac_rx_ctlfrm_cnt_mii port 0 mac receive control frame count register, section 13.3.2.22 0424h-043fh reserved rese rved for future use 0440h mac_tx_cfg_mii port 0 mac transmit configuration register, section 13.3.2.23 0441h mac_tx_fc_settings_mii port 0 mac transmit flow control settings register, section 13.3.2.24 0442h-0450h reserved reserved for future use 0451h mac_tx_defer_cnt_mii port 0 mac transmit deferred count register, section 13.3.2.25 0452h mac_tx_pause_cnt_mii port 0 mac transmit pause count register, section 13.3.2.26 0453h mac_tx_pktok_cnt_mii port 0 mac transmit ok count register, section 13.3.2.27 0454h mac_tx_64_cnt_mii port 0 mac transmit 64 byte count register, section 13.3.2.28 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 259 revision 2.0 (02-14-13) datasheet 0455h mac_tx_65_to_127_cnt_mii port 0 mac transmit 65 to 127 byte count register, section 13.3.2.29 0456h mac_tx_128_to_255_cnt_mii port 0 mac transmit 128 to 255 byte count register, section 13.3.2.30 0457h mac_tx_256_to_511_cnt_mii port 0 mac transmit 256 to 511 byte count register, section 13.3.2.31 0458h mac_tx_512_to_1023_cnt_mii port 0 mac transmit 512 to 1023 byte count register, section 13.3.2.32 0459h mac_tx_1024_to_max_cnt_mii port 0 mac transmit 1024 to max byte count register, section 13.3.2.33 045ah mac_tx_undsze_cnt_mii port 0 mac transmit undersize count register, section 13.3.2.34 045bh reserved reserved for future use 045ch mac_tx_pktlen_cnt_mii port 0 mac transmit packet length count register, section 13.3.2.35 045dh mac_tx_brdcst_cnt_mii port 0 mac transmit broadcast count register, section 13.3.2.36 045eh mac_tx_mulcst_cnt_mii port 0 mac transmit mu lticast count register, section 13.3.2.37 045fh mac_tx_latecol_mii port 0 mac transmit late collision count register, section 13.3.2.38 0460h mac_tx_excol_cnt_mii port 0 mac tran smit excessive collision count register, section 13.3.2.39 0461h mac_tx_snglecol_cnt_mii port 0 mac transmit single collision count register, section 13.3.2.40 0462h mac_tx_multicol_cnt_mii port 0 mac transmit multiple collision count register, section 13.3.2.41 0463h mac_tx_totalcol_cnt_mii port 0 mac transmit total collision count register, section 13.3.2.42 0464-047fh reserved reserved for future use 0480h mac_imr_mii port 0 mac interrupt mask register, section 13.3.2.43 0481h mac_ipr_mii port 0 mac interrupt pending register, section 13.3.2.44 0482h-07ffh reserved rese rved for future use switch port 1 csrs 0800h mac_ver_id_1 port 1 mac version id register, section 13.3.2.1 0801h mac_rx_cfg_1 port 1 mac receive configuration register, section 13.3.2.2 0802h-080fh reserved rese rved for future use 0810h mac_rx_undsze_cnt_1 port 1 mac receive undersize count register, section 13.3.2.3 0811h mac_rx_64_cnt_1 port 1 mac receive 64 byte count register, section 13.3.2.4 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 260 smsc lan9313/lan9313i datasheet 0812h mac_rx_65_to_127_cnt_1 port 1 mac receive 65 to 127 byte count register, section 13.3.2.5 0813h mac_rx_128_to_255_cnt_1 port 1 mac receive 128 to 255 byte count register, section 13.3.2.6 0814h mac_rx_256_to_511_cnt_1 port 1 mac receive 256 to 511 byte count register, section 13.3.2.7 0815h mac_rx_512_to_1023_cnt_1 port 1 mac receive 512 to 1023 byte count register, section 13.3.2.8 0816h mac_rx_1024_to_max_cnt_1 port 1 mac receive 1024 to max byte count register, section 13.3.2.9 0817h mac_rx_ovrsze_cnt_1 port 1 mac receive oversize count register, section 13.3.2.10 0818h mac_rx_pktok_cnt_1 port 1 ma c receive ok count register, section 13.3.2.11 0819h mac_rx_crcerr_cnt_1 port 1 mac receive crc error count register, section 13.3.2.12 081ah mac_rx_mulcst_cnt_1 port 1 mac receive multicast count register, section 13.3.2.13 081bh mac_rx_brdcst_cnt_1 port 1 mac receive broadcast count register, section 13.3.2.14 081ch mac_rx_pause_cnt_1 port 1 mac receive pause frame count register, section 13.3.2.15 081dh mac_rx_frag_cnt_1 port 1 mac receive fragment error count register, section 13.3.2.16 081eh mac_rx_jabb_cnt_1 port 1 mac receive jabber error count register, section 13.3.2.17 081fh mac_rx_align_cnt_1 port 1 mac receive alignment error count register, section 13.3.2.18 0820h mac_rx_pktlen_cnt_1 port 1 mac receive packet length count register, section 13.3.2.19 0821h mac_rx_goodpktlen_cnt_1 port 1 mac receive good packet length count register, section 13.3.2.20 0822h mac_rx_symbl_cnt_1 port 1 mac re ceive symbol error count register, section 13.3.2.21 0823h mac_rx_ctlfrm_cnt_1 port 1 mac receive control frame count register, section 13.3.2.22 0824h-083fh reserved rese rved for future use 0840h mac_tx_cfg_1 port 1 mac transmit configuration register, section 13.3.2.23 0841h mac_tx_fc_settings_1 port 1 mac transmit flow control settings register, section 13.3.2.24 0842h-0850h reserved reserved for future use 0851h mac_tx_defer_cnt_1 port 1 mac transmit deferred count register, section 13.3.2.25 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 261 revision 2.0 (02-14-13) datasheet 0852h mac_tx_pause_cnt_1 port 1 mac transmit pause count register, section 13.3.2.26 0853h mac_tx_pktok_cnt_1 port 1 mac transmit ok count register, section 13.3.2.27 0854h mac_rx_64_cnt_1 port 1 mac transmit 64 byte count register, section 13.3.2.28 0855h mac_tx_65_to_127_cnt_1 port 1 mac transmit 65 to 127 byte count register, section 13.3.2.29 0856h mac_tx_128_to_255_cnt_1 port 1 mac transmit 128 to 255 byte count register, section 13.3.2.30 0857h mac_tx_256_to_511_cnt_1 port 1 mac transmit 256 to 511 byte count register, section 13.3.2.31 0858h mac_tx_512_to_1023_cnt_1 port 1 mac transmit 512 to 1023 byte count register, section 13.3.2.32 0859h mac_tx_1024_to_max_cnt_1 port 1 mac transmit 1024 to max byte count register, section 13.3.2.33 085ah mac_tx_undsze_cnt_1 port 1 mac tr ansmit undersize count register, section 13.3.2.34 085bh reserved reserved for future use 085ch mac_tx_pktlen_cnt_1 port 1 mac transmit packet length count register, section 13.3.2.35 085dh mac_tx_brdcst_cnt_1 port 1 mac tr ansmit broadcast count register, section 13.3.2.36 085eh mac_tx_mulcst_cnt_1 port 1 mac transmit multicast count register, section 13.3.2.37 085fh mac_tx_latecol_1 port 1 mac transmit late collision count register, section 13.3.2.38 0860h mac_tx_excol_cnt_1 port 1 mac transm it excessive collision count register, section 13.3.2.39 0861h mac_tx_snglecol_cnt_1 port 1 mac transmit single collision count register, section 13.3.2.40 0862h mac_tx_multicol_cnt_1 port 1 mac transmit multiple collision count register, section 13.3.2.41 0863h mac_tx_totalcol_cnt_1 port 1 mac transmit total collision count register, section 13.3.2.42 0864-087fh reserved reserved for future use 0880h mac_imr_1 port 1 mac interrupt mask register, section 13.3.2.43 0881h mac_ipr_1 port 1 mac interrupt pending register, section 13.3.2.44 0882h-0bffh reserved reserved for future use switch port 2 csrs 0c00h mac_ver_id_2 port 2 mac version id register, section 13.3.2.1 0c01h mac_rx_cfg_2 port 2 mac receive configuration register, section 13.3.2.2 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 262 smsc lan9313/lan9313i datasheet 0c02 h -0c0f h reserved reserved for future use 0c10h mac_rx_undsze_cnt_2 port 2 mac receive undersize count register, section 13.3.2.3 0c11h mac_rx_64_cnt_2 port 2 mac receive 64 byte count register, section 13.3.2.4 0c12h mac_rx_65_to_127_cnt_2 port 2 mac receive 65 to 127 byte count register, section 13.3.2.5 0c13h mac_rx_128_to_255_cnt_2 port 2 mac receive 128 to 255 byte count register, section 13.3.2.6 0c14h mac_rx_256_to_511_cnt_2 port 2 mac receive 256 to 511 byte count register, section 13.3.2.7 0c15h mac_rx_512_to_1023_cnt_2 port 2 mac receive 512 to 1023 byte count register, section 13.3.2.8 0c16h mac_rx_1024_to_max_cnt_2 port 2 mac receive 1024 to max byte count register, section 13.3.2.9 0c17h mac_rx_ovrsze_cnt_2 port 2 mac receive oversize count register, section 13.3.2.10 0c18h mac_rx_pktok_cnt_2 port 2 mac receive ok count register, section 13.3.2.11 0c19h mac_rx_crcerr_cnt_2 port 2 mac receive crc error count register, section 13.3.2.12 0c1ah mac_rx_mulcst_cnt_2 port 2 mac receive multicast count register, section 13.3.2.13 0c1bh mac_rx_brdcst_cnt_2 port 2 mac receive broadcast count register, section 13.3.2.14 0c1ch mac_rx_pause_cnt_2 port 2 mac receive pause frame count register, section 13.3.2.15 0c1dh mac_rx_frag_cnt_2 port 2 mac receive fragment error count register, section 13.3.2.16 0c1eh mac_rx_jabb_cnt_2 port 2 mac rece ive jabber error count register, section 13.3.2.17 0c1fh mac_rx_align_cnt_2 port 2 mac receive alignment error count register, section 13.3.2.18 0c20h mac_rx_pktlen_cnt_2 port 2 mac receive packet length count register, section 13.3.2.19 0c21h mac_rx_goodpktlen_cnt_2 port 2 mac receive good packet length count register, section 13.3.2.20 0c22h mac_rx_symbl_cnt_2 port 2 mac receive symbol error count register, section 13.3.2.21 0c23h mac_rx_ctlfrm_cnt_2 port 2 mac receive control frame count register, section 13.3.2.22 0c24 h -0c3f h reserved reserved for future use 0c40h mac_tx_cfg_2 port 2 mac transmit configuration register, section 13.3.2.23 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 263 revision 2.0 (02-14-13) datasheet 0c41h mac_tx_fc_settings_2 port 2 mac transmit flow control settings register, section 13.3.2.24 0c42h-0c50h reserved rese rved for future use 0c51h mac_tx_defer_cnt_2 port 2 mac transmit deferred count register, section 13.3.2.25 0c52h mac_tx_pause_cnt_2 port 2 mac transmit pause count register, section 13.3.2.26 0c53h mac_tx_pktok_cnt_2 port 2 mac transmit ok count register, section 13.3.2.27 0c54h mac_rx_64_cnt_2 port 2 mac transmit 64 byte count register, section 13.3.2.28 0c55h mac_tx_65_to_127_cnt_2 port 2 mac transmit 65 to 127 byte count register, section 13.3.2.29 0c56h mac_tx_128_to_255_cnt_2 port 2 mac transmit 128 to 255 byte count register, section 13.3.2.30 0c57h mac_tx_256_to_511_cnt_2 port 2 mac transmit 256 to 511 byte count register, section 13.3.2.31 0c58h mac_tx_512_to_1023_cnt_2 port 2 mac transmit 512 to 1023 byte count register, section 13.3.2.32 0c59h mac_tx_1024_to_max_cnt_2 port 2 mac transmit 1024 to max byte count register, section 13.3.2.33 0c5ah mac_tx_undsze_cnt_2 port 2 mac tr ansmit undersize count register, section 13.3.2.34 0c5bh reserved reserved for future use 0c5ch mac_tx_pktlen_cnt_2 port 2 mac transmit packet length count register, section 13.3.2.35 0c5dh mac_tx_brdcst_cnt_2 port 2 mac tr ansmit broadcast count register, section 13.3.2.36 0c5eh mac_tx_mulcst_cnt_2 port 2 mac transmit multicast count register, section 13.3.2.37 0c5fh mac_tx_latecol_2 port 2 mac transmit late collision count register, section 13.3.2.38 0c60h mac_tx_excol_cnt_2 port 2 mac transm it excessive collision count register, section 13.3.2.39 0c61h mac_tx_snglecol_cnt_2 port 2 mac transmit single collision count register, section 13.3.2.40 0c62h mac_tx_multicol_cnt_2 port 2 mac transmit multiple collision count register, section 13.3.2.41 0c63h mac_tx_totalcol_cnt_2 port 2 mac transmit total collision count register, section 13.3.2.42 0c64-0c7fh reserved reserved for future use 0c80h mac_imr_2 port 2 mac interrupt mask register, section 13.3.2.43 0c81h mac_ipr_2 port 2 mac interrupt pending register, section 13.3.2.44 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 264 smsc lan9313/lan9313i datasheet 0c82 h -17ff h reserved reserved for future use switch engine csrs 1800h swe_alr_cmd switch engine alr command register, section 13.3.3.1 1801h swe_alr_wr_dat_0 switch engine alr write data 0 register, section 13.3.3.2 1802h swe_alr_wr_dat_1 switch engine alr write data 1 register, section 13.3.3.3 1803h-1804h reserved reserved for future use 1805h swe_alr_rd_dat_0 switch engine alr read data 0 register, section 13.3.3.4 1806h swe_alr_rd_dat_1 switch engine alr read data 1 register, section 13.3.3.5 1807h reserved reserved for future use 1808h swe_alr_cmd_sts switch engine alr command status register, section 13.3.3.6 1809h swe_alr_cfg switch engine alr configuration register, section 13.3.3.7 180ah reserved reserved for future use 180bh swe_vlan_cmd switch engine vlan command register, section 13.3.3.8 180ch swe_vlan_wr_data switch engine vlan write data register, section 13.3.3.9 180dh reserved reserved for future use 180eh swe_vlan_rd_data switch engine vlan read data register, section 13.3.3.10 180fh reserved reserved for future use 1810h swe_vlan_cmd_sts switch engine vlan command status register, section 13.3.3.11 1811h swe_diffserv_tbl_cmd switch engine difserv table command register, section 13.3.3.12 1812h swe_diffserv_tbl_wr_data switch engine diffserv table write data register, section 13.3.3.13 1813h swe_diffserv_tbl_rd_data switch engine diffserv ta ble read data register, section 13.3.3.14 1814h swe_diffserv_tbl_cmd_sts switch engine diffserv tabl e command status register, section 13.3.3.15 1815h-183fh reserved rese rved for future use 1840h swe_glb_ingress_cfg switch engine global ingress configuration register, section 13.3.3.16 1841h swe_port_ingress_cfg switch engine port ingress configuration register, section 13.3.3.17 1842h swe_admt_only_vlan switch engine admit only vlan register, section 13.3.3.18 1843h swe_port_state switch engine port state register, section 13.3.3.19 1844h reserved reserved for future use 1845h swe_pri_to_que switch engine priority to queue register, section 13.3.3.20 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 265 revision 2.0 (02-14-13) datasheet 1846h swe_port_mirror switch engine port mirroring register, section 13.3.3.21 1847h swe_ingress_port_typ switch engine ingress port type register, section 13.3.3.22 1848h swe_bcst_throt switch engine broadcast throttling register, section 13.3.3.23 1849h swe_admt_n_member switch engi ne admit non member register, section 13.3.3.24 184ah swe_ingress_rate_cfg switch engine ingress rate configuration register, section 13.3.3.25 184bh swe_ingress_rate_cmd switch engine ingress rate command register, section 13.3.3.26 184ch swe_ingress_rate_cmd_sts switch engine ingress rate command status register, section 13.3.3.27 184dh swe_ingress_rate_wr_data switch engine ingress ra te write data register, section 13.3.3.28 184eh swe_ingress_rate_rd_data switch engine ingress rate read data register, section 13.3.3.29 184fh reserved reserved for future use 1850h swe_filtered_cnt_mii switch engine port 0 ingress filtered count register, section 13.3.3.30 1851h swe_filtered_cnt_1 switch engine port 1 ingress filtered count register, section 13.3.3.31 1852h swe_filtered_cnt_2 switch engine port 2 ingress filtered count register, section 13.3.3.32 1853h-1854h reserved reserved for future use 1855h swe_ingress_regen_tbl_mii switch engine port 0 ingre ss vlan priority regeneration register, section 13.3.3.33 1856h swe_ingress_regen_tbl_1 switch engine port 1 ingre ss vlan priority regeneration register, section 13.3.3.34 1857h swe_ingress_regen_tbl_2 switch engine port 2 ingre ss vlan priority regeneration register, section 13.3.3.35 1858h swe_lrn_discrd_cnt_mii switch engine port 0 learn discard count register, section 13.3.3.36 1859h swe_lrn_discrd_cnt_1 switch engine port 1 learn discard count register, section 13.3.3.37 185ah swe_lrn_discrd_cnt_2 switch engine port 2 learn discard count register, section 13.3.3.38 185bh-187fh reserved reserved for future use 1880h swe_imr switch engine interrupt mask register, section 13.3.3.39 1881h swe_ipr switch engine interrupt pending register, section 13.3.3.40 1882h-1bffh reserved reserved for future use buffer manager (bm) csrs table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 266 smsc lan9313/lan9313i datasheet 1c00h bm_cfg buffer manager configuration register, section 13.3.4.1 1c01h bm_drop_lvl buffer manager drop level register, section 13.3.4.2 1c02h bm_fc_pause_lvl buffer manager flow control pause level register, section 13.3.4.3 1c03h bm_fc_resume_lvl buffer manager flow control resume level register, section 13.3.4.4 1c04h bm_bcst_lvl buffer manager broadcast buffer level register, section 13.3.4.5 1c05h bm_drp_cnt_src_mii buffer manager port 0 drop count register, section 13.3.4.6 1c06h bm_drp_cnt_src_1 buffer manager port 1 drop count register, section 13.3.4.7 1c07h bm_drp_cnt_src_2 buffer manager port 2 drop count register, section 13.3.4.8 1c08h bm_rst_sts buffer manager reset status register, section 13.3.4.9 1c09h bm_rndm_dscrd_tbl_cmd buffer manager random discard table command register, section 13.3.4.10 1c0ah bm_rndm_dscrd_tbl_wdata buffer manager random discard table write data register, section 13.3.4.11 1c0bh bm_rndm_dscrd_tbl_rdata buffer manager random discard table read data register, section 13.3.4.12 1c0ch bm_egrss_port_type buffer mana ger egress port type register, section 13.3.4.13 1c0dh bm_egrss_rate_00_01 buffer manager port 0 egress rate priority queue 0/1 register, section 13.3.4.14 1c0eh bm_egrss_rate_02_03 buffer manager port 0 egress rate priority queue 2/3 register, section 13.3.4.15 1c0fh bm_egrss_rate_10_11 buffer manager port 1 egress rate priority queue 0/1 register, section 13.3.4.16 1c10h bm_egrss_rate_12_13 buffer manager port 1 egress rate priority queue 2/3 register, section 13.3.4.17 1c11h bm_egrss_rate_20_21 buffer manager port 2 egress rate priority queue 0/1 register, section 13.3.4.18 1c12h bm_egrss_rate_22_23 buffer manager port 2 egress rate priority queue 2/3 register, section 13.3.4.19 1c13h bm_vlan_mii buffer mana ger port 0 default vlan id and priority register, section 13.3.4.20 1c14h bm_vlan_1 buffer manager port 1 de fault vlan id and priority register, section 13.3.4.21 1c15h bm_vlan_2 buffer manager port 2 de fault vlan id and priority register, section 13.3.4.22 1c16h bm_rate_drp_cnt_src_mii buffer manager port 0 ingress rate drop count register, section 13.3.4.23 1c17h bm_rate_drp_cnt_src_1 buffer manager port 1 ingress rate drop count register, section 13.3.4.24 table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 267 revision 2.0 (02-14-13) datasheet 1c18h bm_rate_drp_cnt_src_2 buffer manager port 2 ingress rate drop count register, section 13.3.4.25 1c19 h -1c1f h reserved reserved for future use 1c20h bm_imr buffer manager interrupt mask register, section 13.3.4.26 1c21h bm_ipr buffer manager interrupt pending register, section 13.3.4.27 1c22 h -ffff h reserved reserved for future use table 13.12 indirectly accessible switch control and status registers (continued) register # symbol register name downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 268 smsc lan9313/lan9313i datasheet 13.3.1 general switch csrs this section details the general switch fabric csrs. these registers control the main reset and interrupt functions of the switch fabric. a list of the general switch csrs and their corresponding register numbers is included in table 13.12 . 13.3.1.1 switch device id register (sw_dev_id) this read-only register contains sw itch device id informat ion, including the devi ce type, chip version and revision codes. register #: 0000h size: 32 bits bits description type default 31:24 reserved ro - 23:16 device type code (device_type) ro 03h 15:8 chip version code (chip_version) ro 04h 7:0 revision code (revision) ro 07h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 269 revision 2.0 (02-14-13) datasheet 13.3.1.2 switch reset register (sw_reset) this register contains the switch fabric global reset. refer to section 4.2, "resets," on page 43 for more information. register #: 0001h size: 32 bits bits description type default 31:1 reserved ro - 0 switch fabric reset (sw_reset) this bit is the global switch fabric reset. all switch fabric blocks are affected. this bit must be manually cleared. wo 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 270 smsc lan9313/lan9313i datasheet 13.3.1.3 switch global interrupt mask register (sw_imr) this read/write register contains the global interr upt mask for the switch fabric interrupts. all switch related interrupts in the switch global interrupt pending register (sw_ipr) may be masked via this register. an interrupt is masked by setting the co rresponding bit of this register. clearing a bit will unmask the interrupt. when an unmasked switch fabric interrupt is generated in the switch global interrupt pending register (sw_ipr) , the interrupt will trigger the switch_int bit in the interrupt status register (int_sts) . refer to chapter 5, "system interrupts," on page 55 for more information. register #: 0004h size: 32 bits bits description type default 31:9 reserved ro - 8:7 reserved note: these bits must be written as 11b r/w 11b 6 buffer manager interrupt mask (bm) when set, prevents the generation of switch fabric interrupts due to the buffer manager via the buffer manager interrupt pending register (bm_ipr) . the status bits in the sw_ipr register are not affected. r/w 1b 5 switch engine interrupt mask (swe) when set, prevents the generation of switch fabric interrupts due to the switch engine via the switch engine interrupt pending register (swe_ipr) . the status bits in the sw_ipr register are not affected. r/w 1b 4:3 reserved note: these bits must be written as 11b r/w 11b 2 port 2 mac interrupt mask (mac_2) when set, prevents the generation of switch fabric interrupts due to the port 2 mac via the mac_ipr_2 register (see section 13.3.2.44, on page 315 ). the status bits in the sw_ipr register are not affected. r/w 1b 1 port 1 mac interrupt mask (mac_1) when set, prevents the generation of switch fabric interrupts due to the port 1 mac via the mac_ipr_1 register (see section 13.3.2.44, on page 315 ). the status bits in the sw_ipr register are not affected. r/w 1b 0 port 0 mac interrupt mask (mac_mii) when set, prevents the generation of switch fabric interrupts due to the port 0 mac via the mac_ipr_mii register (see section 13.3.2.44, on page 315 ). the status bits in the sw_ipr register are not affected. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 271 revision 2.0 (02-14-13) datasheet 13.3.1.4 switch global interrupt pending register (sw_ipr) this read-only register contains the pending global interrupts for the switch fabric. a set bit indicates an unmasked bit in the corresponding switch fabric sub-system has been triggered. all switch related interrupts in this regist er may be masked via the switch global interrupt mask register (sw_imr) register. when an unmasked switch fabric interrupt is generated in this register, the interrupt will trigger the switch_int bit in the interrupt status register (int_sts) . refer to chapter 5, "system interrupts," on page 55 for more information. register #: 0005h size: 32 bits bits description type default 31:7 reserved ro - 6 buffer manager interrupt (bm) set when any unmasked bit in the buffer manager interrupt pending register (bm_ipr) is triggered. this bit is cleared upon a read. rc 0b 5 switch engine interrupt (swe) set when any unmasked bit in the switch engine interrupt pending register (swe_ipr) is triggered. this bit is cleared upon a read. rc 0b 4:3 reserved ro - 2 port 2 mac interrupt (mac_2) set when any unmasked bit in the mac_ipr_2 register (see section 13.3.2.44, on page 315 ) is triggered. this bit is cleared upon a read. rc 0b 1 port 1 mac interrupt (mac_1) set when any unmasked bit in the mac_ipr_1 register (see section 13.3.2.44, on page 315 ) is triggered. this bit is cleared upon a read. rc 0b 0 port 0 mac interrupt (mac_mii) set when any unmasked bit in the mac_ipr_mii register (see section 13.3.2.44, on page 315 ) is triggered. this bit is cleared upon a read. rc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 272 smsc lan9313/lan9313i datasheet 13.3.2 switch port 0, port 1, and port 2 csrs this section details the switch port 0(external mii), port 1, and port 2 csrs. each port provides a functionally identical set of registers which allow for the configuration of port settings, interrupts, and the monitoring of the various packet counters. because the port 0, port 1, and port 2 csrs are functionally identical, their register descriptions have been consolidated. a lowercase x has been appended to the end of each switch port register name in this section, where x should be replaced with m ii, 1, or 2 for the po rt 0, port 1, or port 2 registers respectively. a list of the switch port 0, port 1, and port 2 registers and their corresponding register numbers is included in table 13.12 . 13.3.2.1 port x mac version id register (mac_ver_id_x) this read-only register contains sw itch device id informat ion, including the devi ce type, chip version and revision codes. register #: port0: 0400h size: 32 bits port1: 0800h port2: 0c00h bits description type default 31:12 reserved ro - 11:8 device type code (device_type) ro 5h 7:4 chip version code (chip_version) ro 8h 3:0 revision code (revision) ro 3h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 273 revision 2.0 (02-14-13) datasheet 13.3.2.2 port x mac receive configuration register (mac_rx_cfg_x) this read/write register configures the packet type passing parameters of the port. register #: port0: 0401h size: 32 bits port1: 0801h port2: 0c01h bits description type default 31:8 reserved ro - 7 reserved note: this bit must always be written as 0. r/w 0b 6 reserved ro - 5 enable receive own transmit when set, the switch port will receive its own transmission if it is looped back from the phy. normally, this function is only used in half duplex phy loopback. r/w 0b 4 reserved ro - 3 jumbo2k when set, the maximum packet size ac cepted is 2048 bytes. statistics boundaries are also adjusted. r/w 0b 2 reserved ro - 1 reject mac types when set, mac control frames (packets with a type field of 8808h) are filtered. when cleared, mac control frames, other than mac control pause frames, are sent to the forwarding process. mac control pause frames are always consumed by the switch. r/w 1b 0 rx enable when set, the receive port is enabled. when cleared, the receive port is disabled. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 274 smsc lan9313/lan9313i datasheet 13.3.2.3 port x mac receive undersize count register (mac_rx_undsze_cnt_x) this register provides a counter of undersized packets received by the port. the counter is cleared upon being read. register #: port0: 0410h size: 32 bits port1: 0810h port2: 0c10h bits description type default 31:0 rx undersize count of packets that have less than 64 byte and a valid fcs. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 115 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 275 revision 2.0 (02-14-13) datasheet 13.3.2.4 port x mac receive 64 byte count register (mac_rx_64_cnt_x) this register provides a counter of 64 byte packets received by the port. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes is rounded down to the nearest byte. register #: port0: 0411h size: 32 bits port1: 0811h port2: 0c11h bits description type default 31:0 rx 64 bytes count of packets (including bad packets) that have exactly 64 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 276 smsc lan9313/lan9313i datasheet 13.3.2.5 port x mac receive 65 to 127 byte count register (mac_rx_65_to_127_cnt_x) this register provides a counter of received packets between the size of 65 to 127 bytes. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes is rounded down to the nearest byte. register #: port0: 0412h size: 32 bits port1: 0812h port2: 0c12h bits description type default 31:0 rx 65 to 127 bytes count of packets (including bad packets) that have between 65 and 127 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 487 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 277 revision 2.0 (02-14-13) datasheet 13.3.2.6 port x mac receive 128 to 255 byte count register (mac_rx_128_to_255_cnt_x) this register provides a counter of received packets between the size of 128 to 255 bytes. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes is rounded down to the nearest byte. register #: port0: 0413h size: 32 bits port1: 0813h port2: 0c13h bits description type default 31:0 rx 128 to 255 bytes count of packets (including bad packets) that have between 128 and 255 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 848 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 278 smsc lan9313/lan9313i datasheet 13.3.2.7 port x mac receive 256 to 511 byte count register (mac_rx_256_to_511_cnt_x) this register provides a counter of received packets between the size of 256 to 511 bytes. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes is rounded down to the nearest byte. register #: port0: 0414h size: 32 bits port1: 0814h port2: 0c14h bits description type default 31:0 rx 256 to 511 bytes count of packets (including bad packets) that have between 256 and 511 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 1581 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 279 revision 2.0 (02-14-13) datasheet 13.3.2.8 port x mac receive 512 to 1023 byte count register (mac_rx_512_to_1023_cnt_x) this register provides a counter of received packets between the size of 512 to 1023 byte s. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes is rounded down to the nearest byte. register #: port0: 0415h size: 32 bits port1: 0815h port2: 0c15h bits description type default 31:0 rx 512 to 1023 bytes count of packets (including bad packets) that have between 512 and 1023 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 3047 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 280 smsc lan9313/lan9313i datasheet 13.3.2.9 port x mac receive 1024 to max byte count register (mac_rx_1024_to_max_cnt_x) this register provides a counter of received packets between the size of 1024 to the maximum allowable number bytes. the counter is cleared upon being read. note: a bad packet is defined as a packet that has an fcs or symbol error. for this counter, a packet with the maximum number of bytes that is not an integral number of bytes (e.g. a 1518 1/2 byte packet) is counted. register #: port0: 0416h size: 32 bits port1: 0816h port2: 0c16h bits description type default 31:0 rx 1024 to max bytes count of packets (including bad packets) that have between 1024 and the maximum allowable number of bytes. the max number of bytes is 1518 for untagged packets and 1522 for tagged packets. if jumbo2k (bit 3) is set in the port x mac receive configuration register (mac_rx_cfg_x) , the max number of bytes is 2048. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 5979 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 281 revision 2.0 (02-14-13) datasheet 13.3.2.10 port x mac receive oversize count register (mac_rx_ovrsze_cnt_x) this register provides a counter of received packet s with a size greater than the maximum byte size. the counter is cleared upon being read. note: for this counter, a packet with the maximum number of bytes that is not an integral number of bytes (e.g. a 1518 1/2 byte packet) is not considered oversize. register #: port0: 0417h size: 32 bits port1: 0817h port2: 0c17h bits description type default 31:0 rx oversize count of packets that have more than the maximum allowable number of bytes and a valid fcs. the max number of bytes is 1518 for untagged packets and 1522 for tagged packets. if jumbo2k (bit 3) is set in the port x mac receive configuration register (mac_rx_cfg_x) , the max number of bytes is 2048. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 8813 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 282 smsc lan9313/lan9313i datasheet 13.3.2.11 port x mac receive ok co unt register (mac_rx_pktok_cnt_x) this register provides a counter of received packets that are or proper length and are free of errors. the counter is cleared upon being read. note: a bad packet is one that has a fcs or symbol error. register #: port0: 0418h size: 32 bits port1: 0818h port2: 0c18h bits description type default 31:0 rx ok count of packets that are of proper length and are free of errors. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 283 revision 2.0 (02-14-13) datasheet 13.3.2.12 port x mac receive crc error count register (mac_rx_crcerr_cnt_x) this register provides a counter of received packets that with crc errors. the counter is cleared upon being read. register #: port0: 0419h size: 32 bits port1: 0819h port2: 0c19h bits description type default 31:0 rx crc count of packets that have between 64 and the maximum allowable number of bytes and have a bad fcs, but do not have an extra nibble. the max number of bytes is 1518 for untagged packets and 1522 for tagged packets. if jumbo2k (bit 3) is set in the port x mac receive configuration register (mac_rx_cfg_x) , the max number of bytes is 2048. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 137 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 284 smsc lan9313/lan9313i datasheet 13.3.2.13 port x mac receive multicast count register (m ac_rx_mulcst_cnt_x) this register provides a counter of valid received packets with a multicast destination address. the counter is cleared upon being read. note: a bad packet is one that has a fcs or symbol error. register #: port0: 041ah size: 32 bits port1: 081ah port2: 0c1ah bits description type default 31:0 rx multicast count of good packets (proper length and free of errors), including mac control frames, that have a multicast destination address (not including broadcasts). note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 285 revision 2.0 (02-14-13) datasheet 13.3.2.14 port x mac receive broadc ast count register (mac_rx_brdcst_cnt_x) this register provides a counter of valid received packets with a broadcast destination address. the counter is cleared upon being read. note: a bad packet is one that has a fcs or symbol error. register #: port0: 041bh size: 32 bits port1: 081bh port2: 0c1bh bits description type default 31:0 rx broadcast count of valid packets (proper length and free of errors) that have a broadcast destination address. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 286 smsc lan9313/lan9313i datasheet 13.3.2.15 port x mac receive pause fram e count register (mac_rx_pause_cnt_x) this register provides a counter of valid received pause frame packets. the counter is cleared upon being read. note: a bad packet is one that has a fcs or symbol error. register #: port0: 041ch size: 32 bits port1: 081ch port2: 0c1ch bits description type default 31:0 rx pause frame count of valid packets (proper length and free of errors) that have a type field of 8808h and an op-code of 0001(pause). note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 287 revision 2.0 (02-14-13) datasheet 13.3.2.16 port x mac receive fragment er ror count register (mac_rx_frag_cnt_x) this register provides a counter of received packets of less than 64 bytes and a fcs error. the counter is cleared upon being read. register #: port0: 041dh size: 32 bits port1: 081dh port2: 0c1dh bits description type default 31:0 rx fragment count of packets that have less than 64 bytes and a fcs error. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 115 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 288 smsc lan9313/lan9313i datasheet 13.3.2.17 port x mac receive jabber erro r count register (mac_rx_jabb_cnt_x) this register provides a counter of received packets with greater than the maximum allowable number of bytes and a fcs error. the counter is cleared upon being read. note: for this counter, a packet with the maximum number of bytes that is not an integral number of bytes (e.g. a 1518 1/2 byte packet) and contains a fcs error is not considered jabber and is not counted here. register #: port0: 041eh size: 32 bits port1: 081eh port2: 0c1eh bits description type default 31:0 rx jabber count of packets that have more than the maximum allowable number of bytes and a fcs error. the max number of bytes is 1518 for untagged packets and 1522 for tagged packets. if jumbo2k (bit 3) is set in the port x mac receive configuration register (mac_rx_cfg_x) , the max number of bytes is 2048. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 8813 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 289 revision 2.0 (02-14-13) datasheet 13.3.2.18 port x mac receive alignment error count register (mac_rx_align_cnt_x) this register provides a counter of received packets with 64 bytes to the maximum allowable, and a fcs error. the counter is cleared upon being read. note: for this counter, a packet with the maximum number of bytes that is not an integral number of bytes (e.g. a 1518 1/2 byte packet) and a fcs error is considered an alignment error and is counted. register #: port0: 041fh size: 32 bits port1: 081fh port2: 0c1fh bits description type default 31:0 rx alignment count of packets that have between 64 bytes and the maximum allowable number of bytes and are not byte aligned and have a bad fcs. the max number of bytes is 1518 for untagged packets and 1522 for tagged packets. if jumbo2k (bit 3) is set in the port x mac receive configuration register (mac_rx_cfg_x) , the max number of bytes is 2048. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 290 smsc lan9313/lan9313i datasheet 13.3.2.19 port x mac receive packet lengt h count register (mac_rx_pktlen_cnt_x) this register provides a counter of total bytes received. the counter is cleared upon being read. note: if necessary, for oversized packets, the packet is either truncated at 1518 bytes (untagged, jumbo2k=0), 1522 bytes (tagged, jumbo2k=0), or 2048 bytes (jumbo2k=1). if this occurs, the byte count recorded is 1518, 1522, or 2048, respectively. the jumbo2k bit is located in the port x mac receive configuration register (mac_rx_cfg_x) . note: a bad packet is one that has an fcs or symbol error. for this counter, a packet that is not an integral number of bytes (e.g. a 1518 1/2 byte packet) is rounded down to the nearest byte. register #: port0: 0420h size: 32 bits port1: 0820h port2: 0c20h bits description type default 31:0 rx bytes count of total bytes received (including bad packets). note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 5.8 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 291 revision 2.0 (02-14-13) datasheet 13.3.2.20 port x mac receive good packet length count register (mac_rx_goodpktlen_cnt_x) this register provides a counter of total bytes received in good packets. the coun ter is cleared upon being read. note: a bad packet is one that has an fcs or symbol error. register #: port0: 0421h size: 32 bits port1: 0821h port2: 0c21h bits description type default 31:0 rx good bytes count of total bytes received in good packets (proper length and free of errors). note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 5.8 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 292 smsc lan9313/lan9313i datasheet 13.3.2.21 port x mac receive symbol error count register (mac_rx_symbol_cnt_x) this register provides a counter of received packe ts with a symbol error. the counter is cleared upon being read. register #: port0: 0422h size: 32 bits port1: 0822h port2: 0c22h bits description type default 31:0 rx symbol count of packets that had a receive symbol error. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 115 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 293 revision 2.0 (02-14-13) datasheet 13.3.2.22 port x mac receive control frame count register (mac_rx_ctlfrm_cnt_x) this register provides a counter of good packets with a type field of 8808h. the counter is cleared upon being read. note: a bad packet is one that has an fcs or symbol error. register #: port0: 0423h size: 32 bits port1: 0823h port2: 0c23h bits description type default 31:0 rx control frame count of good packets (proper length and free of errors) that have a type field of 8808h. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 294 smsc lan9313/lan9313i datasheet 13.3.2.23 port x mac transmit configuration register (mac_tx_cfg_x) this read/write register configures the transmit packet parameters of the port. register #: port0: 0440h size: 32 bits port1: 0840h port2: 0c40h bits description type default 31:8 reserved ro - 7 mac counter test when set, tx and rx counters that normally clear to 0 when read, will be set to 7fff_fffch when read with the exception of the port x mac receive packet length count register (mac_rx_pktlen_cnt_x) , port x mac transmit packet length count register (mac_tx_pktlen_cnt_x) , and port x mac receive good packet length count register (mac_rx_goodpktlen_cnt_x) counters which will be set to 7fff_ff80h. r/w 0b 6:2 ifg config these bits control the transmit inter-frame gap. ifg bit times = (ifg config *4) + 12 note: ifg config values less than 15 are unsupported. r/w 10101b 1 tx pad enable when set, packets shorter than 64 bytes are padded with zeros if needed and a fcs is appended. packets that are 60 bytes or less will become 64 bytes. packets that are 61, 62, and 63 bytes will become 65, 66, and 67 bytes respectively. r/w 1b 0 tx enable when set, the transmit port is enabled. when cleared, the transmit port is disabled. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 295 revision 2.0 (02-14-13) datasheet 13.3.2.24 port x mac transmit flow control settings register (mac_tx_fc_settings_x) this read/write register configures the flow control settings of the port. register #: port0: 0441h size: 32 bits port1: 0841h port2: 0c41h bits description type default 31:18 reserved ro - 17:16 backoff reset rx/tx half duplex-only. determines when the truncated binary exponential backoff attempts counter is reset. 00 = reset on successful transmission (ieee standard) 01 = reset on successful reception 1x = reset on either successf ul transmission or reception r/w 00b 15:0 pause time value the value that is inserted into the transmitted pause packet when the switch wants to xoff its link partner. r/w ffffh downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 296 smsc lan9313/lan9313i datasheet 13.3.2.25 port x mac transmit deferred count register (mac_tx_defer_cnt_x) this register provides a counter deferred packets. the counter is cleared upon being read. register #: port0: 0451h size: 32 bits port1: 0851h port2: 0c51h bits description type default 31:0 tx deferred count of packets that were available for transmission but were deferred on the first transmit attempt due to network traffic (either on receive or prior transmission). this counter is not incremented on collisions. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 297 revision 2.0 (02-14-13) datasheet 13.3.2.26 port x mac transmit pause count register (mac_tx_pause_cnt_x) this register provides a counter of transmitted pause packets. the counter is cleared upon being read. register #: port0: 0452h size: 32 bits port1: 0852h port2: 0c52h bits description type default 31:0 tx pause count of pause packets transmitted. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 298 smsc lan9313/lan9313i datasheet 13.3.2.27 port x mac transmit ok count register (mac_tx_pktok_cnt_x) this register provides a counter of successful transmissions. the counter is cleared upon being read. register #: port0: 0453h size: 32 bits port1: 0853h port2: 0c53h bits description type default 31:0 tx okcount of successful transm issions. undersize packets are not included in this count. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 299 revision 2.0 (02-14-13) datasheet 13.3.2.28 port x mac transmit 64 byte count register (mac_tx_64_cnt_x) this register provides a counter of 64 byte packe ts transmitted by the port. the counter is cleared upon being read. register #: port0: 0454h size: 32 bits port1: 0854h port2: 0c54h bits description type default 31:0 tx 64 bytes count of packets that have exactly 64 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 300 smsc lan9313/lan9313i datasheet 13.3.2.29 port x mac transmit 65 to 127 by te count register (mac_tx_65_to_127_cnt_x) this register provides a counter of transmitted packets between the size of 65 to 127 bytes. the counter is cleared upon being read. register #: port0: 0455h size: 32 bits port1: 0855h port2: 0c55h bits description type default 31:0 tx 65 to 127 bytes count of packets that have between 65 and 127 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 487 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 301 revision 2.0 (02-14-13) datasheet 13.3.2.30 port x mac transmit 128 to 255 byte count register (mac_tx_128_to_255_cnt_x) this register provides a counter of transmitted packets between the size of 128 to 255 bytes. the counter is cleared upon being read. register #: port0: 0456h size: 32 bits port1: 0856h port2: 0c56h bits description type default 31:0 tx 128 to 255 bytes count of packets that have between 128 and 255 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 848 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 302 smsc lan9313/lan9313i datasheet 13.3.2.31 port x mac transmit 256 to 511 byte count register (mac_tx_256_to_511_cnt_x) this register provides a counter of transmitted pa ckets between the size of 256 to 511 bytes. the counter is cleared upon being read. register #: port0: 0457h size: 32 bits port1: 0857h port2: 0c57h bits description type default 31:0 tx 256 to 511 bytes count of packets that have between 256 and 511 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 1581 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 303 revision 2.0 (02-14-13) datasheet 13.3.2.32 port x mac transmit 512 to 1023 byte count register (mac_tx_512_to_1023_cnt_x) this register provides a counter of transmitted packets between the size of 512 to 1023 bytes. the counter is cleared upon being read. register #: port0: 0458h size: 32 bits port1: 0858h port2: 0c58h bits description type default 31:0 tx 512 to 1023 bytes count of packets that have between 512 and 1023 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 3047 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 304 smsc lan9313/lan9313i datasheet 13.3.2.33 port x mac transmit 1024 to max by te count register (m ac_tx_1024_to_max_cnt_x) this register provides a counte r of transmitted packets between the size of 1024 to the maximum allowable number bytes. the counter is cleared upon being read. register #: port0: 0459h size: 32 bits port1: 0859h port2: 0c59h bits description type default 31:0 tx 1024 to max bytes count of packets that have more than 1024 bytes. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 5979 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 305 revision 2.0 (02-14-13) datasheet 13.3.2.34 port x mac transmit undersiz e count register (m ac_tx_undsze_cnt_x) this register provides a counter of undersized packe ts transmitted by the port. the counter is cleared upon being read. register #: port0: 045ah size: 32 bits port1: 085ah port2: 0c5ah bits description type default 31:0 tx undersize count of packets that have less than 64 bytes. note: this condition could occur when tx padding is disabled and a tag is removed. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 458 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 306 smsc lan9313/lan9313i datasheet 13.3.2.35 port x mac transmit packet length count register (mac_tx_pktlen_cnt_x) this register provides a counter of total bytes transmitted. the counter is cleared upon being read. register #: port0: 045ch size: 32 bits port1: 085ch port2: 0c5ch bits description type default 31:0 tx bytes count of total bytes transmitted (does not include bytes from collisions, but does include bytes from pause packets). note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 5.8 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 307 revision 2.0 (02-14-13) datasheet 13.3.2.36 port x mac transmit broadcast count register (mac_tx_brdcst_cnt_x) this register provides a counter of transmitted broadcast packets. the counter is cleared upon being read. register #: port0: 045dh size: 32 bits port1: 085dh port2: 0c5dh bits description type default 31:0 tx broadcast count of broadcast packets transmitted. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 308 smsc lan9313/lan9313i datasheet 13.3.2.37 port x mac transmit multicast count register (mac_tx_mulcst_cnt_x) this register provides a counter of transmitted mu lticast packets. the counter is cleared upon being read. register #: port0: 045eh size: 32 bits port1: 085eh port2: 0c5eh bits description type default 31:0 tx multicast count of multicast packets transmitted including mac control pause frames. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 309 revision 2.0 (02-14-13) datasheet 13.3.2.38 port x mac transmit late collision count register (mac_tx_latecol_cnt_x ) this register provides a counter of transmitted pa ckets which experienced a late collision. the counter is cleared upon being read. register #: port0: 045fh size: 32 bits port1: 085fh port2: 0c5fh bits description type default 31:0 tx late collision count of transmitted packets that experienced a late collision. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 310 smsc lan9313/lan9313i datasheet 13.3.2.39 port x mac transmit excessive coll ision count register (mac_tx_exccol_cnt_x) this register provides a counter of transmitted packets which experienced 16 collisions. the counter is cleared upon being read. register #: port0: 0460h size: 32 bits port1: 0860h port2: 0c60h bits description type default 31:0 tx excessive collision count of transmitted packets that experienced 16 collisions. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 1466 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 311 revision 2.0 (02-14-13) datasheet 13.3.2.40 port x mac transmit single collisi on count register (mac_tx_snglecol_cnt_x) this register provides a counter of transmitted packets which ex perienced exactly 1 collision. the counter is cleared upon being read. register #: port0: 0461h size: 32 bits port1: 0861h port2: 0c61h bits description type default 31:0 tx excessive collision count of transmitted packets that ex perienced exactly 1 collision. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 573 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 312 smsc lan9313/lan9313i datasheet 13.3.2.41 port x mac transmit multiple collision count register (mac_tx_multicol_cnt_x) this register provides a counter of transmitted pa ckets which experienced between 2 and 15 collisions. the counter is cleared upon being read. register #: port0: 0462h size: 32 bits port1: 0862h port2: 0c62h bits description type default 31:0 tx excessive collision count of transmitted packets that experienced between 2 and 15 collisions. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 664 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 313 revision 2.0 (02-14-13) datasheet 13.3.2.42 port x mac transmit total collision count register (mac_tx_totalcol_cnt_x) this register provides a counter of total collisions including late collisions. the counter is cleared upon being read. register #: port0: 0463h size: 32 bits port1: 0863h port2: 0c63h bits description type default 31:0 tx total collision total count of collisions including late collisions. this counter is incremented only in half-duplex operation. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 92 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 314 smsc lan9313/lan9313i datasheet 13.3.2.43 port x mac interrupt mask register (mac_imr_x) this register contains the port x interru pt mask. port x related interrupts in the port x mac interrupt pending register (mac_ipr_x) may be masked via this register. an interrupt is masked by setting the corresponding bit of this register. clearing a bit will unmask the interrupt. refer to chapter 5, "system interrupts," on page 55 for more information. note: there are no possible port x interrupt conditions available. this register exists for future use, and should be configured as indicated for future compatibility. register #: port0: 0480h size: 32 bits port1: 0880h port2: 0c80h bits description type default 31:8 reserved ro - 7:0 reserved note: these bits must be written as 11h r/w 11h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 315 revision 2.0 (02-14-13) datasheet 13.3.2.44 port x mac interrupt pending register (mac_ipr_x) this read-only register contains the pending port x interrupts. a set bit indicates an interrupt has been triggered. all interrupts in this register may be masked via the port x mac interrupt pending register (mac_ipr_x) register. refer to chapter 5, "system interrupts," on page 55 for more information. note: there are no possible port x interrupt conditions available. this register exists for future use. register #: port0: 0481h size: 32 bits port1: 0881h port2: 0c81h bits description type default 31:0 reserved ro - downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 316 smsc lan9313/lan9313i datasheet 13.3.3 switch engine csrs this section details the switch engine related csrs. these registers allow configuration and monitoring of the various switch engine components including the alr, vlan, port vid, and diffserv tables. a list of the general switch csrs and their corresponding register numbers is included in table 13.12 . 13.3.3.1 switch engine alr command register (swe_alr_cmd) this register is used to manually read and write mac addresses from/into the alr table. for a read access, the switch engine alr read data 0 register (swe_alr_rd_dat_0) and switch engine alr read data 1 register (swe_alr_rd_dat_1) should be read following the setting of bit 1(get first entry) or bit 0(get next entry) of this register. for write access, the switch engine alr write data 0 register (swe_alr_wr_dat_0) and switch engine alr write data 1 register (swe_alr_wr_dat_1) registers should first be written with the mac address, followed by the setting of bit 2(make entry) of this register. the make pending bit in the switch engine alr command status register (swe_alr_cmd_sts) register indicates when the command is finished. refer to chapter 6, "switch fabric," on page 60 for more information. register #: 1800h size: 32 bits bits description type default 31:3 reserved ro - 2 make entry when set, the contents of alr_wr_dat_0 and alr_wr_dat_1 are written into the alr table. the alr logic determines the location where the entry is written. this command can also be used to change or delete a previously written or automatically learned entry. this bit has no affect when written low. this bit must be cleared once the alr make command is completed, which can be determined by the alr status bit in the switch engine alr command status register (swe_alr_cmd_sts) register. r/w 0b 1 get first entry when set, the alr read pointer is reset to the beginning of the alr table and the alr table is searched for the first valid entry, which is loaded into the alr_rd_dat_0 and alr_rd_dat_1 registers. the bit has no affect when written low. this bit must be cleared after it is set. r/w 0b 0 get next entry when set, the next valid entry in the alr mac address table is loaded into the alr_rd_dat_0 and alr_rd_dat_1 registers. this bit has no affect when written low. this bit must be cleared after it is set. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 317 revision 2.0 (02-14-13) datasheet 13.3.3.2 switch engine alr write data 0 register (swe_alr_wr_dat_0) this register is used in conjunction with the switch engine alr write data 1 register (swe_alr_wr_dat_1) and contains the first 32 bits of alr data to be manually written via the make entry command in the switch engine alr command register (swe_alr_cmd) . register #: 1801h size: 32 bits bits description type default 31:0 mac address this field contains the first 32 bits of the alr entry that will be written into the alr table. these bits correspond to the first 32 bits of the mac address. bit 0 holds the lsb of the first byte (the multicast bit). r/w 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 318 smsc lan9313/lan9313i datasheet 13.3.3.3 switch engine alr write data 1 register (swe_alr_wr_dat_1) this register is used in conjunction with the switch engine alr write data 0 register (swe_alr_wr_dat_0) and contains the last 32 bits of alr data to be manually written via the make entry command in the switch engine alr command register (swe_alr_cmd) . register #: 1802h size: 32 bits bits description type default 31:25 reserved ro - 24 valid when set, this bit makes the entry valid. it can be cleared to invalidate a previous entry that contained the specified mac address. r/w 0b 23 age/override this bit is used by the aging and forwarding processes. if the static bit of this register is cleared, this bit should be set so that the entry will age in the normal amount of time. if the static bit is set, this bit is used as a port state override bit. when set, packets received with a destination address that matches the mac address in the swe_alr_wr _dat_1 and swe_alr_wr_dat_0 registers will be forwarded regardless of the port state of the ingress or egress port(s). this is typically used to allow the reception of bpdu packets in the non- forwarding state. r/w 0b 22 static when this bit is set, this entry will not be removed by the aging process and/or be changed by the learning process. when this bit is cleared, this entry will be automatically removed after 5 to 10 minutes of inactivity. inactivity is defined as no packets being received with a source address that matches this mac address. note: this bit is normally set when adding manual entries. it must be cleared when removing an entry (clearing the valid bit). r/w 0b 21 filter when set, packets with a destination address that matches this mac address will be filtered. r/w 0b 20:19 priority these bits specify the priority that is used for packets with a destination address that matches this mac address. this priority is only used if the static bit of this register is set, and the da highest priority (bit 5) in the switch engine global ingress configuration register (swe_global_ingrss_cfg) is set. r/w 00b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 319 revision 2.0 (02-14-13) datasheet 18:16 port these bits indicate the port(s) associated with this mac address. when bit 18 is cleared, a single port is selected. when bit 18 is set, multiple ports are selected. r/w 000b 15:0 mac address these field contains the last 16 bits of the alr entry that will be written into the alr table. they correspond to the last 16 bits of the mac address. bit 15 holds the msb of the last byte (the last bit on the wire). the first 32 bits of the mac address are located in the switch engine al r write data 0 register (swe_alr_wr_dat_0) . r/w 0000h bits description type default value associated port(s) 000 port 0(external mii) 001 port 1 010 port 2 011 reserved 100 port 0(external mii) and port 1 101 port 0(external mii) and port 2 110 port 1 and port 2 111 port 0(external mii), port 1, and port 2 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 320 smsc lan9313/lan9313i datasheet 13.3.3.4 switch engine alr read data 0 register (swe_alr_rd_dat_0) this register is used in conjunction with the switch engine alr read data 1 register (swe_alr_rd_dat_1) to read the alr table. it contains the first 32 bits of the alr entry and is loaded via the get first entry or get next entry commands in the switch engine alr command register (swe_alr_cmd) . this register is only valid when either of the valid or end of table bits in the switch engine alr read data 1 register (swe_alr_rd_dat_1) are set. register #: 1805h size: 32 bits bits description type default 31:0 mac address this field contains the first 32 bits of the alr entry. these bits correspond to the first 32 bits of the mac address. bit 0 holds the lsb of the first byte (the multicast bit). ro 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 321 revision 2.0 (02-14-13) datasheet 13.3.3.5 switch engine alr read data 1 register (swe_alr_rd_dat_1) this register is used in conjunction with the switch engine alr read data 0 register (swe_alr_rd_dat_0) to read the alr table. it contains the last 32 bits of the alr entry and is loaded via the get first entry or get next entry commands in the switch engine alr command register (swe_alr_cmd) . this register is only valid when either of the valid or end of table bits are set. register #: 1806h size: 32 bits bits description type default 31:25 reserved ro - 24 valid this bit is cleared when the get first entry or get next entry bits of the switch engine alr command register (swe_alr_cmd) are written. this bit is set when a valid entry is found in the alr table. this bit stays cleared when the top of the alr table is reached without finding an entry. ro 0b 23 end of table this bit indicates that the end of the alr table has been reached and further get next entry commands are not required. note: the valid bit may or may not be set when the end of the table is reached. ro 0b 22 static indicates that this entry will not be removed by the aging process. when this bit is cleared, this entry will be automatically removed after 5 to 10 minutes of inactivity. inactivity is defined as no packets being received with a source address that matches this mac address. ro 0b 21 filter when set, indicates that packets with a destinat ion address that matches this mac address will be filtered. ro 0b 20:19 priority these bits indicate the priority that is used for packets with a destination address that matches this mac address. this priority is only used if the static bit of this register is set, and the da highest priority (bit 5) in the switch engine global ingress configuration register (swe_global_ingrss_cfg) register is set. ro 00b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 322 smsc lan9313/lan9313i datasheet 18:16 port these bits indicate the port(s) associated with this mac address. when bit 18 is cleared, a single port is selected. when bit 18 is set, multiple ports are selected. ro 000b 15:0 mac address these field contains the last 16 bits of the alr entry. they correspond to the last 16 bits of the mac address. bit 15 holds the msb of the last byte (the last bit on the wire). the first 32 bits of the mac address are located in the switch engine alr read data 0 register (swe_alr_rd_dat_0) . ro 0000h bits description type default value associated port(s) 000 port 0(external mii) 001 port 1 010 port 2 011 reserved 100 port 0(external mii) and port 1 101 port 0(external mii) and port 2 110 port 1 and port 2 111 port 0(external mii), port 1, and port 2 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 323 revision 2.0 (02-14-13) datasheet 13.3.3.6 switch engine alr command status register (swe_alr_cmd_sts) this register indicates the current alr command status. note 13.64 the default value of this bit is 0 immediately following any switch fabric reset and then self- sets to 1 once the alr table is initialized. register #: 1808h size: 32 bits bits description type default 31:2 reserved ro - 1 alr init done when set, indicates that the alr table has finished being initialized by the reset process. the initialization is performed upon any reset that resets the switch fabric. the initialization takes approximately 20us. during this time, any received packet will be dropped. software should monitor this bit before writing any of the alr tables or registers. ro ss note 13.64 0 make pending when set, indicates that the make entry command is taking place. this bit is cleared once the make entry command has finished. ro sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 324 smsc lan9313/lan9313i datasheet 13.3.3.7 switch engine alr config uration register (swe_alr_cfg) this register controls the alr aging timer duration. register #: 1809h size: 32 bits bits description type default 31:1 reserved ro - 0 alr age test when set, this bit decreases the aging timer from 5 minutes to 50ms. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 325 revision 2.0 (02-14-13) datasheet 13.3.3.8 switch engine vlan command register (swe_vlan_cmd) this register is used to read and write the vlan or port vid tables. a write to this address performs the specified access. for a read access, the operation pending bit in the switch engine vlan command status register (swe_vlan_cmd_sts) indicates when the command is finished. the switch engine vlan read data register (swe_vlan_rd_data) can then be read. for a write access, the switch engine vlan write data register (swe_vlan_wr_data) register should be written first. the operation pending bit in the switch engine vlan command status register (swe_vlan_cmd_sts) indicates when the command is finished. register #: 180bh size: 32 bits bits description type default 31:6 reserved ro - 5 vlan rnw this bit specifies a read(1) or a write(0) command. r/w 0b 4 pvidnvlan when set, this bit selects the port vid table. when cleared, this bit selects the vlan table. r/w 0b 3:0 vlan/port this field specifies the vlan(0-15) or port(0-2) to be read or written. note: values outside of the valid range may cause unexpected results. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 326 smsc lan9313/lan9313i datasheet 13.3.3.9 switch engine vlan write data register (swe_vlan_wr_data) this register is used write the vlan or port vid tables. register #: 180ch size: 32 bits bits description type default 31:18 reserved ro - 17:0 port default vi d and priority when the port vid table is selected (pvidnvlan=1 of the switch engine vlan command register (swe_vlan_cmd) ), bits 11:0 of this field specify the default vid for the port and bits 14:12 specify the default priority. all other bits of this field are reserved. these bits are used when a packet is received without a vlan tag or with a null vlan id. by default, the vid and priority for all three ports is 0. note: values of 0 and fffh should not be used since they are special vlan ids per the ieee 802.3q specification. vlan data when the vlan table is sele cted (pvidnvlan=0 of the switch engine vlan command register (swe_vlan_cmd) ), the bits form the vlan table entry as follows: r/w 0b bits description default 17 member port 2 indicates the configuration of port 2 for this vlan entry. 1 = member - packets with a vid that matches this entry are allowed on ingress. the port is a member of the broadcast domain on egress. 0 = not a member - packets with a vid that matches this entry are filtered on ingress unless the admit non member bit in the switch engine admit non member register (swe_admt_n_member) is set for this port. the port is not a member of the broadcast domain on egress. 0b 16 un-tag port 2 when this bit is set, packets received on port 2 with a vid that matches this entry will hav e their tag removed when re- transmitted by egress ports that are designated as hybrid ports via the buffer manager egress port type register (bm_egrss_port_type) . 0b 15 member port 1 see description for member port 2. 0b 14 un-tag port 1 see description for un-tag port 2. 0b 13 member port 0 (external mii) see description for member port 2. 0b 12 un-tag port 0 (external mii) see description for un-tag port 2. 0b 11:0 vid these bits specify the vlan id associated with this vlan entry. to disable a vlan entry, a value of 0 should be used. note: a value of 0 is considered a null vlan and should not normally be used other than to disable a vlan entry. note: a value of 3ffh is considered reserved by ieee 802.1q and should not be used. 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 327 revision 2.0 (02-14-13) datasheet 13.3.3.10 switch engine vlan read data register (swe_vlan_rd_data) this register is used to read the vlan or port vid tables. register #: 180eh size: 32 bits bits description type default 31:18 reserved ro - 17:0 port default vi d and priority when the port vid table is selected (pvidnvlan=1 of the switch engine vlan command register (swe_vlan_cmd) ), bits 11:0 of this field specify the default vid for the port and bits 14:12 specify the default priority. all other bits of this field are reserved. these bits are used when a packet is received without a vlan tag or with a null vlan id. by default, the vid and priority for all three ports is 0. vlan data when the vlan table is sele cted (pvidnvlan=0 of the switch engine vlan command register (swe_vlan_cmd) ), the bits form the vlan table entry as follows: ro 00000h bits description default 17 member port 2 indicates the configuration of port 2 for this vlan entry. 1 = member - packets with a vid that matches this entry are allowed on ingress. the port is a member of the broadcast domain on egress. 0 = not a member - packets with a vid that matches this entry are filtered on ingress unless the admit non member bit in the switch engine admit non member register (swe_admt_n_member) is set for this port. the port is not a member of the broadcast domain on egress. 0b 16 un-tag port 2 when this bit is set, packets received on port 2 with a vid that matches this entry will hav e their tag removed when re- transmitted by egress ports that are designated as hybrid ports via the buffer manager egress port type register (bm_egrss_port_type) . 0b 15 member port 1 see description for member port 2. 0b 14 un-tag port 1 see description for un-tag port 2. 0b 13 member port 0 (external mii) see description for member port 2. 0b 12 un-tag port 0 (external mii) see description for un-tag port 2. 0b 11:0 vid these bits specify the vlan id associated with this vlan entry. 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 328 smsc lan9313/lan9313i datasheet 13.3.3.11 switch engine vlan command status register (swe_vlan_cmd_sts) this register indicates the current vlan command status. register #: 1810h size: 32 bits bits description type default 31:1 reserved ro - 0 operation pending when set, this bit indicates that the read or write command is taking place. this bit is cleared once the command has finished. ro sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 329 revision 2.0 (02-14-13) datasheet 13.3.3.12 switch engine diffserv table command register (swe_diffserv_tbl_cfg) this register is used to read and write the diffserv table. a write to this address performs the specified access. this table is used to map the received ip tos/cs to a priority. for a read access, the operation pending bit in the switch engine diffserv table command status register (swe_diffserv_tbl_cmd_sts) indicates when the command is finished. the switch engine diffserv table read data register (swe_diffserv_tbl_rd_data) can then be read. for a write access, the switch engine diffserv table write data register (swe_diffserv_tbl_wr_data) register should be written first. the operation pending bit in the switch engine diffserv table command stat us register (swe_diffserv_tbl_cmd_sts) indicates when the command is finished. register #: 1811h size: 32 bits bits description type default 31:8 reserved ro - 7 diffserv table rnw this bit specifies a read(1) or a write(0) command. r/w 0b 6 reserved ro - 5:0 diffserv table index this field specifies the tos/ cs entry that is accessed. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 330 smsc lan9313/lan9313i datasheet 13.3.3.13 switch engine diffserv table writ e data register (swe_diffserv_tbl_wr_data) this register is used to write the diffserv table. the diffserv table is not initialized upon reset on power-up. if diffserv is enabled, the full table should be initialized by the host. register #: 1812h size: 32 bits bits description type default 31:3 reserved ro - 2:0 diffserv priority these bits specify the assigned receive priority for ip packets with a tos/cs field that matches this index. r/w 000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 331 revision 2.0 (02-14-13) datasheet 13.3.3.14 switch engine diffserv table read data register (swe_diffserv_tbl_rd_data) this register is used to read the diffserv table. register #: 1813h size: 32 bits bits description type default 31:3 reserved ro - 2:0 diffserv priority these bits specify the assigned receive priority for ip packets with a tos/cs field that matches this index. ro 000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 332 smsc lan9313/lan9313i datasheet 13.3.3.15 switch engine diffserv table command status register (swe_diffserv_tbl_cmd_sts) this register indicates the current diffserv command status. register #: 1814h size: 32 bits bits description type default 31:1 reserved ro - 0 operation pending when set, this bit indicates that the read or write command is taking place. this bit is cleared once the command has finished. ro sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 333 revision 2.0 (02-14-13) datasheet 13.3.3.16 switch engine global ingress conf iguration register (swe_global_ingrss_cfg) this register is used to configure the global ingress rules. register #: 1840h size: 32 bits bits description type default 31:14 reserved ro - 13 allow monitorin echo when set, monitored packets are allowed to be echoed back to the source port. when cleared, monitored packets, like other packets, are never sent back to the source port. this bit is useful when the monitoring port wishes to receive its own igmp packets. r/w 0b 12:10 igmp monitoring port this field is the port bit map where ipv4 igmp packets are sent. r/w 0b 9 use ip when set, the ipv4 tos or ipv6 sc field is enabled as a transmit priority queue choice. r/w 0b 8 reserved r/w 0b 7 enable igmp monitoring when set, ipv4 igmp packets are monitored and sent to the igmp monitoring port. r/w 0b 6 swe counter test when this bit is set the switch engine counters that normally clear to 0 when read will be set to 7fff_fffch when read. r/w 0b 5 da highest priority when this bit is set and the static bit in the alr table for the destination mac address is set, the transmit priority queue that is selected is taken from the alr priority bits (see the switch engine alr read data 1 register (swe_alr_rd_dat_1) ). r/w 0b 4 filter multicast when this bit is set, packets with a multicast destination address are filtered if the address is not found in the alr table. broadcasts are not included in this filter. r/w 0b 3 drop unknown when this bit is set, packets with a unicast destination address are filtered if the address is not found in the alr table. r/w 0b 2 use precedence when the priority is taken from an ipv4 packet (enabled via the use ip bit), this bit selects between precedence bits in the tos octet or the diffserv table. when set, ipv4 packets will use the precedence bits in the tos octet to select the transmit priority queue. when cleared, ipv4 packets will use the diffserv table to select th e transmit priority queue. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 334 smsc lan9313/lan9313i datasheet 1 vl higher priority when this bit is set and vlans are enabled, the priority from the vlan tag has higher priority than the ip tos/sc field. r/w 1b 0 vlan enable when set, vlan ingress rules are enabled. this also enables the vlan to be used as the transmit priority queue selection. r/w 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 335 revision 2.0 (02-14-13) datasheet 13.3.3.17 switch engine port ingress conf iguration register (swe_port_ingrss_cfg) this register is used to configure the per port ingress rules. register #: 1841h size: 32 bits bits description type default 31:6 reserved ro - 5:3 enable learning on ingress when set, source addresses are learned when a packet is received on the corresponding port and the corresponding port state in the switch engine port state register (swe_port_state) is set to forwarding or learning. there is one enable bit per ingress port. bits 5,4,3 correspond to switch ports 2,1,0 respectively. r/w 111b 2:0 enable membership checking when set, vlan membership is checked when a packet is received on the corresponding port. the packet will be filtered if the ingress port is not a member of the vlan (unless the admit non member bit is set for the port in the switch engine admit non member register (swe_admt_n_member) ) for destination addresses that are found in the alr table, the packet will be filtered if the egress port is not a member of the vlan (for destination addresses that are not found in the alr table only the ingress port is checked for membership). the vlan enable bit in the switch engine global ingress configuration register (swe_global_ingrss_cfg) needs to be set for these bits to have an affect. there is one enable bit per ingress port. bits 2,1,0 correspond to switch ports 2,1,0 respectively. r/w 000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 336 smsc lan9313/lan9313i datasheet 13.3.3.18 switch engine admit only vlan register (swe_admt_only_vlan) this register is used to configure the per port ingress rule for allowing only vlan tagged packets. register #: 1842h size: 32 bits bits description type default 31:3 reserved ro - 2:0 admit only vlan when set, untagged and priority tagged packets are filtered. the vlan enable bit in the switch engine global ingress configuration register (swe_global_ingrss_cfg) needs to be set for these bits to have an affect. there is one enable bit per ingress port. bits 2,1,0 correspond to switch ports 2,1,0 respectively. r/w 000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 337 revision 2.0 (02-14-13) datasheet 13.3.3.19 switch engine port state register (swe_port_state) this register is used to configure the per port spanning tree state. register #: 1843h size: 32 bits bits description type default 31:6 reserved ro - 5:4 port state port 2 these bits specify the spanning tree port states for port 2. 00 = forwarding 01 = blocking 10 = learning 11 = listening r/w 00b 3:2 port state port 1 these bits specify the spanning tree port states for port 1. 00 = forwarding 01 = blocking 10 = learning 11 = listening r/w 00b 1:0 port state port 0 these bits specify the spanning tree port states for port 0(external mii). 00 = forwarding 01 = blocking 10 = learning 11 = listening r/w 00b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 338 smsc lan9313/lan9313i datasheet 13.3.3.20 switch engine priority to queue register (swe_pri_to_que) this register specifies the traffic class table that maps the packet priority into the egress queues. register #: 1845h size: 32 bits bits description type default 31:16 reserved ro - 15:14 priority 7 traffic class these bits specify the egress queue that is used for packets with a priority of 7. r/w 11b 13:12 priority 6 traffic class these bits specify the egress queue that is used for packets with a priority of 6. r/w 11b 11:10 priority 5 traffic class these bits specify the egress queue that is used for packets with a priority of 5. r/w 10b 9:8 priority 4 traffic class these bits specify the egress queue that is used for packets with a priority of 4. r/w 10b 7:6 priority 3 traffic class these bits specify the egress queue that is used for packets with a priority of 3. r/w 01b 5:4 priority 2 traffic class these bits specify the egress queue that is used for packets with a priority of 2. r/w 00b 3:2 priority 1 traffic class these bits specify the egress queue that is used for packets with a priority of 1. r/w 00b 1:0 priority 0 traffic class these bits specify the egress queue that is used for packets with a priority of 0. r/w 01b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 339 revision 2.0 (02-14-13) datasheet 13.3.3.21 switch engine port mi rroring register (swe_port_mirror) this register is used to configure port mirroring. register #: 1846h size: 32 bits bits description type default 31:9 reserved ro - 8 enable rx mirroring filtered when set, packets that would normally have been filtered are included in the receive mirroring function and are sent only to the sniffer port. when cleared, filtered packets are not mirrored. note: the ingress filtered count registers will still count these packets as filtered and the switch engine interrupt pending register (swe_ipr) will still register a drop interrupt. r/w 0b 7:5 sniffer port these bits specify the sniffer port that transmits packets that are monitored. bits 7,6,5 correspond to swit ch ports 2,1,0 respectively. note: only one port should be set as the sniffer. r/w 00b 4:2 mirrored port these bits specify if a port is to be mirrored. bits 4,3,2 correspond to switch ports 2,1,0 respectively. note: multiple ports can be set as mirrored. r/w 00b 1 enable rx mirroring this bit enables packets received on the mirrored ports to be also sent to the sniffer port. r/w 0b 0 enable tx mirroring this bit enables packets transmitted on the mirrored ports to be also sent to the sniffer port. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 340 smsc lan9313/lan9313i datasheet 13.3.3.22 switch engine ingress port type register (swe_ingrss_port_typ) this register is used to enable the special taggi ng mode used to determine the destination port based on the vlan tag contents. register #: 1847h size: 32 bits bits description type default 31:6 reserved ro - 5:4 ingress port type port 2 a setting of 11b enables the usage of the vlan tag to specify the packet destination. all other values disable this feature. r/w 00b 3:2 ingress port type port 1 a setting of 11b enables the usage of the vlan tag to specify the packet destination. all other values disable this feature. r/w 00b 1:0 ingress port type port 0 a setting of 11b enables the usage of the vlan tag to specify the packet destination. all other values disable this feature. r/w 00b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 341 revision 2.0 (02-14-13) datasheet 13.3.3.23 switch engine broadcast thr ottling register (swe_bcst_throt) this register configures the broadcast input rate throttling. register #: 1848h size: 32 bits bits description type default 31:27 reserved ro - 26 broadcast throttle enable port 2 this bit enables broadcast input rate throttling on port 2. r/w 0b 25:18 broadcast throttle level port 2 these bits specify the number of bytes x 64 allowed to be received per every 1.72ms interval. r/w 02h 17 broadcast throttle enable port 1 this bit enables broadcast input rate throttling on port 1. r/w 0b 16:9 broadcast throttle level port 1 these bits specify the number of bytes x 64 allowed to be received per every 1.72ms interval. r/w 02h 8 broadcast throttle enable port 0 this bit enables broadcast input rate throttling on port 0(external mii). r/w 0b 7:0 broadcast throttle level port 0 these bits specify the number of bytes x 64 allowed to be received per every 1.72ms interval. r/w 02h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 342 smsc lan9313/lan9313i datasheet 13.3.3.24 switch engine admit non member register (swe_admt_n_member) this register is used to allow access to a vlan even if the ingress port is not a member. register #: 1849h size: 32 bits bits description type default 31:3 reserved ro - 2:0 admit non member when set, a received packet is accepted even if the ingress port is not a member of the destination vlan. the vlan still must be active in the switch. there is one bit per ingress port. bits 2,1,0 correspond to switch ports 2,1,0 respectively. r/w 000b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 343 revision 2.0 (02-14-13) datasheet 13.3.3.25 switch engine ingress rate conf iguration register (swe_ingrss_rate_cfg) this register, along with the settings accessible via the switch engine ingress rate command register (swe_ingrss_rate_cmd) , is used to configure the ingress rate metering/coloring. register #: 184ah size: 32 bits bits description type default 31:3 reserved ro - 2:1 rate mode these bits configure the rate metering/coloring mode. 00 = source po rt & priority 01 = source port only 10 = priority only 11 = reserved r/w 00b 0 ingress rate enable when set, ingress rates are metered and packets are colored and dropped if necessary. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 344 smsc lan9313/lan9313i datasheet 13.3.3.26 switch engine ingress rate co mmand register (swe_ingrss_rate_cmd) this register is used to indirectly read and write the ingress rate metering/color table registers. a write to this address performs the specified access. for a read access, the operation pending bit in the switch engine ingress rate command status register (swe_ingrss_rate_cmd_sts) indicates when the command is finished. the switch engine ingress rate read data register (swe_ingrss_rate_rd_data) can then be read. for a write access, the switch engine ingress rate write data register (swe_ingrss_rate_wr_data) should be written first. the operation pending bit in the switch engine ingress rate command status register (swe_ingrss_rate_cmd_sts) indicates when the command is finished. for details on 16-bit wide ingress rate table registers indirectly accessible by this register, see section 13.3.3.26.1 below. register #: 184bh size: 32 bits bits description type default 31:8 reserved ro - 7 ingress rate rnw these bits specify a read(1) or write(0) command. r/w 0b 6:5 type these bits select between the ingress rate metering/color table registers as follows: 00 = reserved 01 = committed information rate registers (uses cis address field) 10 = committed burst register 11 = excess burst register r/w 00b 4:0 cir address these bits select one of the 24 committed information rate registers. when rate mode is set to source port & priority in the switch engine ingress rate configuration register (swe_ingrss_rate_cfg) , the first set of 8 registers (cir addresses 0-7) ar e for to port 0, the second set of 8 registers (cir addresses 8-15) are for port 1, and the third set of registers (cir addresses 16-23) are for port 2. priority 0 is the lower register of each set (e.g. 0, 8, and 16). when rate mode is set to source port only, the first register (cir address 0) is for port 0, the second register (cir address 1) is for port 1, and the third register (cir address 2) is for port 2. when rate mode is set to priority only, the first register (cir address 0) is for priority 0, the second register (cir address 1) is for priority 1, and so forth up to priority 23. note: values outside of the valid range may cause unexpected results. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 345 revision 2.0 (02-14-13) datasheet 13.3.3.26.1 ingress rate table registers the ingress rate metering/color table consists of 24 committed information rate (cir) registers (one per port/priority), a committ ed burst size register, and an excess burst size register. all metering/color table registers are 16-bits in size and are accessed indirectly via the switch engine ingress rate command register (swe_ingrss_rate_cmd) . descriptions of these registers are detailed in table 13.13 below. table 13.13 metering/color table register descriptions description type default excess burst size this register specifies the maximum excess bu rst size in bytes. bursts larger than this value that exceed the e xcess data rate are dropped. note: either this value or the committed burst size should be set larger than or equal to the largest possible packet expected. note: all of the excess burst token buckets ar e initialized to this default value. if a lower value is programmed into this register, the token buckets will need to be normally depleted below this value before this value has any affect on limiting the to ken bucket maximum values. this register is 16-bits wide. r/w 0600h committed burst size this register specifies the maximum committed burst size in bytes. bursts larger than this value that exceed the committed data rate are subjected to random dropping. note: either this value or the excess burs t size should be set larger than or equal to the largest possible packet expected. note: all of the committed burst token buckets are initialized to this default value. if a lower value is programmed into this register, the token buckets will need to be normally depleted below this value before this value has any affect on limiting the token bucket maximum values. this register is 16-bits wide. r/w 0600h committed information rate (cir) these registers specify the committed data rate for the port/priority pair. the rate is specified in time per byte. the time is this value plus 1 times 20ns. there are 24 of these registers each 16-bits wide. r/w 0014h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 346 smsc lan9313/lan9313i datasheet 13.3.3.27 switch engine ingress rate command status register (swe_ingrss_rate_cmd_sts) this register indicates the current ingress rate command status. register #: 184ch size: 32 bits bits description type default 31:1 reserved ro - 0 operation pending when set, indicates that the read or write command is taking place. this bit is cleared once the command has finished. ro sc 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 347 revision 2.0 (02-14-13) datasheet 13.3.3.28 switch engine ingress rate write data register (swe_ingrss_rate_wr_data) this register is used to write the ingress rate table registers. register #: 184dh size: 32 bits bits description type default 31:16 reserved ro - 15:0 data this is the data to be written to the ingress rate table registers as specified in the switch engine ingress rate command register (swe_ingrss_rate_cmd) . refer to section 13.3.3.26.1, "ingress rate table registers," on page 345 for details on these registers. r/w 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 348 smsc lan9313/lan9313i datasheet 13.3.3.29 switch engine ingress rate read data register (swe_ingrss_rate_rd_data) this register is used to read the ingress rate table registers. register #: 184eh size: 32 bits bits description type default 31:16 reserved ro - 15:0 data this is the read data from the ingress rate table registers as specified in the switch engine ingress rate command register (swe_ingrss_rate_cmd) . refer to section 13.3.3.26.1, "ingress rate table registers," on page 345 for details on these registers. ro 0000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 349 revision 2.0 (02-14-13) datasheet 13.3.3.30 switch engine port 0 ingress filt ered count register (swe_filtered_cnt_mii) this register counts the number of packets filter ed at ingress on port 0(external mii). this count includes packets filtered due to broadcast throttling but does not include packets dropped due to ingress rate limiting (whi ch are counted separately). register #: 1850h size: 32 bits bits description type default 31:0 filtered this field is a count of packets filtered at ingress and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 350 smsc lan9313/lan9313i datasheet 13.3.3.31 switch engine port 1 ingress filtered count register (swe_filtered_cnt_1) this register counts the number of packets filtered at ingress on port 1. this count includes packets filtered due to broadcast throttling but does not include packets dropped due to ingress rate limiting (which are counted separately). register #: 1851h size: 32 bits bits description type default 31:0 filtered this field is a count of packets filtered at ingress and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 351 revision 2.0 (02-14-13) datasheet 13.3.3.32 switch engine port 2 ingress filtered count register (swe_filtered_cnt_2) this register counts the number of packets filtered at ingress on port 2. this count includes packets filtered due to broadcast throttling but does not include packets dropped due to ingress rate limiting (which are counted separately). register #: 1852h size: 32 bits bits description type default 31:0 filtered this field is a count of packets filtered at ingress and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 352 smsc lan9313/lan9313i datasheet 13.3.3.33 switch engine port 0 ingress vl an priority regeneration table register (swe_ingrss_regen_tbl_mii) this register provides the ability to map the received vlan priority to a regenerated priority. th e regenerated priority is used in determining the output priority queue. by default, the regenerated priority is identical to the received priority. register #: 1855h size: 32 bits bits description type default 31:24 reserved ro - 23:21 regen7 these bits specify the regenerated priority for received priority 7. r/w 7h 20:18 regen6 these bits specify the regenerated priority for received priority 6. r/w 6h 17:15 regen5 these bits specify the regenerated priority for received priority 5. r/w 5h 14:12 regen4 these bits specify the regenerated priority for received priority 4. r/w 4h 11:9 regen3 these bits specify the regenerated priority for received priority 3. r/w 3h 8:6 regen2 these bits specify the regenerated priority for received priority 2. r/w 2h 5:3 regen1 these bits specify the regenerated priority for received priority 1. r/w 1h 2:0 regen0 these bits specify the regenerated priority for received priority 0. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 353 revision 2.0 (02-14-13) datasheet 13.3.3.34 switch engine port 1 ingress vl an priority regeneration table register (swe_ingrss_regen_tbl_1) this register provides the ability to map the received vlan priority to a regenerated priority. th e regenerated priority is used in determining the output priority queue. by default, the regenerated priority is identical to the received priority. register #: 1856h size: 32 bits bits description type default 31:24 reserved ro - 23:21 regen7 these bits specify the regenerated priority for received priority 7. r/w 7h 20:18 regen6 these bits specify the regenerated priority for received priority 6. r/w 6h 17:15 regen5 these bits specify the regenerated priority for received priority 5. r/w 5h 14:12 regen4 these bits specify the regenerated priority for received priority 4. r/w 4h 11:9 regen3 these bits specify the regenerated priority for received priority 3. r/w 3h 8:6 regen2 these bits specify the regenerated priority for received priority 2. r/w 2h 5:3 regen1 these bits specify the regenerated priority for received priority 1. r/w 1h 2:0 regen0 these bits specify the regenerated priority for received priority 0. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 354 smsc lan9313/lan9313i datasheet 13.3.3.35 switch engine port 2 ingress vl an priority regeneration table register (swe_ingrss_regen_tbl_2) this register provides the ability to map the received vlan priority to a regenerated priority. th e regenerated priority is used in determining the output priority queue. by default, the regenerated priority is identical to the received priority. register #: 1857h size: 32 bits bits description type default 31:24 reserved ro - 23:21 regen7 these bits specify the regenerated priority for received priority 7. r/w 7h 20:18 regen6 these bits specify the regenerated priority for received priority 6. r/w 6h 17:15 regen5 these bits specify the regenerated priority for received priority 5. r/w 5h 14:12 regen4 these bits specify the regenerated priority for received priority 4. r/w 4h 11:9 regen3 these bits specify the regenerated priority for received priority 3. r/w 3h 8:6 regen2 these bits specify the regenerated priority for received priority 2. r/w 2h 5:3 regen1 these bits specify the regenerated priority for received priority 1. r/w 1h 2:0 regen0 these bits specify the regenerated priority for received priority 0. r/w 0h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 355 revision 2.0 (02-14-13) datasheet 13.3.3.36 switch engine port 0 learn discar d count register (swe_lrn_discrd_cnt_mii) this register counts the number of mac addresses on port 0(external mii) that were not learned or were overwritten by a different address due to address table space limitations. register #: 1858h size: 32 bits bits description type default 31:0 learn discard this field is a count of mac addresses not learned or overwritten and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 356 smsc lan9313/lan9313i datasheet 13.3.3.37 switch engine port 1 learn disc ard count register (swe_lrn_discrd_cnt_1) this register counts the number of mac addresses on port 1 that were not learned or were overwritten by a different address due to address table space limitations. register #: 1859h size: 32 bits bits description type default 31:0 learn discard this field is a count of mac addresses not learned or overwritten and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 357 revision 2.0 (02-14-13) datasheet 13.3.3.38 switch engine port 2 learn disc ard count register (swe_lrn_discrd_cnt_2) this register counts the number of mac addresses on port 2 that were not learned or were overwritten by a different address due to address table space limitations. register #: 185ah size: 32 bits bits description type default 31:0 learn discard this field is a count of mac addresses not learned or overwritten and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 358 smsc lan9313/lan9313i datasheet 13.3.3.39 switch engine interr upt mask register (swe_imr) this register contains the sw itch engine interrupt mask, wh ich masks the interrupts in the switch engine interrupt pending register (swe_ipr) . all switch engine interrupt s are masked by setting the interrupt mask bit. clearing this bit will unmask the interrupts. refer to chapter 5, "system interrupts," on page 55 for more information. register #: 1880h size: 32 bits bits description type default 31:1 reserved ro - 0 interrupt mask when set, this bit masks interrupts from the switch engine. the status bits in the switch engine interrupt pe nding register (swe_ipr) are not affected. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 359 revision 2.0 (02-14-13) datasheet 13.3.3.40 switch engine interr upt pending register (swe_ipr) this register contains the switch engine interrupt status. the status is double buffered. all interrupts in this register may be masked via the switch engine interrupt mask register (swe_imr) register. refer to chapter 5, "system interrupts," on page 55 for more information. register #: 1881h size: 32 bits bits description type default 31:15 reserved ro - 14:11 drop reason b when bit 8 is set, these bits indicate the reason a packet was dropped per the table below: rc 0h bit values description 0000 admit only vlan was set and the packet was untagged or priority tagged. 0001 the destination address was not in the alr table (unknown or broadcast), enable membership checking on ingress was set, admit non member was cleared and the source port was not a member of the incoming vlan. 0010 the destination address was found in the alr table but the source port was not in the forwarding state. 0011 the destination address was found in the alr table but the destination port was not in the forwarding state. 0100 the destination address was found in the alr table but enable membership checking on ingress was set and the destination port was not a member of the incoming vlan. 0101 the destination address was found in the alr table but the enable membership checking on ingress was set, admit non member was cleared and the source port was not a member of the incoming vlan. 0110 drop unknown was set and the destination address was a unicast but not in the alr table. 0111 filter multicast was set and the destination address was a multicast and not in the alr table. 1000 the packet was a broadcast but exceeded the broadcast throttling limit. 1001 the destination address was not in the alr table (unknown or broadcast) and the source port was not in the forwarding state. 1010 the destination address was found in the alr table but the source and destination ports were the same. 1011 the destination address was found in the alr table and the filter bit was set for that address. 1100 reserved 1101 reserved 1110 a packet was received with a vlan id of fffh 1111 reserved downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 360 smsc lan9313/lan9313i datasheet 10:9 source port b when bit 8 is set, these bits indicate the source port on which the packet was dropped. 00 = port 0 01 = port 1 10 = port 2 11 = reserved rc 00b 8 set b valid when set, bits 14:9 are valid. rc 0b 7:4 drop reason a when bit 1 is set, these bits indicate the reason a packet was dropped. see the drop reason b description above for definitions of each value of this field. rc 0h 3:2 source port a when bit 1 is set, these bits indicate the source port on which the packet was dropped. 00 = port 0 01 = port 1 10 = port 2 11 = reserved rc 00b 1 set a valid when set, bits 7:2 are valid. rc 0b 0 interrupt pending when set, a packet dropped event(s) is indicated. rc 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 361 revision 2.0 (02-14-13) datasheet 13.3.4 buffer manager csrs this section details the buffer manager (bm) regi sters. these registers allow configuration and monitoring of the switch buffer levels and usage. a list of the general switch csrs and their corresponding register numbers is included in table 13.12 . 13.3.4.1 buffer manager configuration register (bm_cfg) this register enables egress rate pacing and ingress rate discarding. register #: 1c00h size: 32 bits bits description type default 31:7 reserved ro - 6 bm counter test when this bit is set, buffer manager (b m) counters that normally clear to 0 when read, will be set to 7fff_fffc when read. r/w 0b 5 fixed priority queue servicing when set, output queues are serviced wi th a fixed priority ordering. when cleared, output queues are serviced with a weighted round robin ordering. r/w 0b 4:2 egress rate enable when set, egress rate pacing is enabled. bits 4,3,2 correspond to switch ports 2,1,0 respectively. r/w 0b 1 drop on yellow when this bit is set, packets that exceed the ingress committed burst size (colored yellow) are subjected to random discard. note: see section 13.3.3.26, "switch engine ingress rate command register (swe_ingrss_rate_cmd)," on page 344 for information on configuring the ingress committed burst size. r/w 0b 0 drop on red when this bit is set, packets that e xceed the ingress excess burst size (colored red) are discarded. note: see section 13.3.3.26, "switch engine ingress rate command register (swe_ingrss_rate_cmd)," on page 344 for information on configuring the ingress excess burst size. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 362 smsc lan9313/lan9313i datasheet 13.3.4.2 buffer manager drop level register (bm_drop_lvl) this register configures the overall buffer usage limits. register #: 1c01h size: 32 bits bits description type default 31:16 reserved ro - 15:8 drop level low these bits specify the buffer limit that can be used per ingress port during times when 2 or 3 ports are active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 49h 7:0 drop level high these bits specify the buffer limit that can be used per ingress port during times when 1 port is active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 64h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 363 revision 2.0 (02-14-13) datasheet 13.3.4.3 buffer manager flow control pause level register (bm_fc_pause_lvl) this register configures the buffer usage level when a pause frame or backpressure is sent. register #: 1c02h size: 32 bits bits description type default 31:16 reserved ro - 15:8 pause level low these bits specify the buffer usage level during times when 2 or 3 ports are active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 21h 7:0 pause level high these bits specify the buffer usage level during times when 1 port is active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 3ch downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 364 smsc lan9313/lan9313i datasheet 13.3.4.4 buffer manager flow control re sume level register (bm_fc_resume_lvl) this register configures the buffer usage level when a pause frame with a pause value of 1 is sent. register #: 1c03h size: 32 bits bits description type default 31:16 reserved ro - 15:8 resume level low these bits specify the buffer usage level during times when 2 or 3 ports are active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 03h 7:0 resume level high these bits specify the buffer usage level during times when 0 or 1 ports are active. each buffer is 128 bytes. note: a port is active when 36 buf fers are in use for that port. r/w 07h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 365 revision 2.0 (02-14-13) datasheet 13.3.4.5 buffer manager broadcast buffer level register (bm_bcst_lvl) this register configures the buffer usage limits for broadcasts, multicasts, and unknown unicasts. register #: 1c04h size: 32 bits bits description type default 31:8 reserved ro - 7:0 broadcast drop level these bits specify the maximum number of buffers that can be used by broadcasts, multicasts, and unknown unicasts. each buffer is 128 bytes. r/w 31h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 366 smsc lan9313/lan9313i datasheet 13.3.4.6 buffer manager port 0 drop count register (bm_drp_cnt_src_mii) this register counts the number of packets dropped by the buffer manager that were received on port 0(external mii). this count includes packets dropped due to buffer space limits and ingress rate limit discarding (red and random yellow dropping). register #: 1c05h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 0 and is cleared when read. note: the counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 367 revision 2.0 (02-14-13) datasheet 13.3.4.7 buffer manager port 1 drop count register (bm_drp_cnt_src_1) this register counts the number of packets dropped by the buffer manager that were received on port 1. this count includes packets dropped due to buffer space limits and ingress rate limit discarding (red and random yellow dropping). register #: 1c06h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 1 and is cleared when read. note: the counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 368 smsc lan9313/lan9313i datasheet 13.3.4.8 buffer manager port 2 drop count register (bm_drp_cnt_src_2) this register counts the number of packets dropped by the buffer manager that were received on port 2. this count includes packets dropped due to buffer space limits and ingress rate limit discarding (red and random yellow dropping). register #: 1c07h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 2 and is cleared when read. note: the counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 369 revision 2.0 (02-14-13) datasheet 13.3.4.9 buffer manager reset status register (bm_rst_sts) this register indicates when the buffer manager has been initialized by the reset process. note 13.65 the default value of this bit is 0 immediately following any switch fabric reset and then self- sets to 1 once the alr table is initialized. register #: 1c08h size: 32 bits bits description type default 31:1 reserved ro - 0 bm ready when set, indicates the buffer manager tables have finished being initialized by the reset process. the initialization is performed upon any reset that resets the switch fabric. ro ss note 13.65 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 370 smsc lan9313/lan9313i datasheet 13.3.4.10 buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd) this register is used to read and write the random discard weight table. a write to this address performs the specified access. this table is used to set the packet drop probability verses the buffer usage. for a read access, the buffer manager random discard table read data register (bm_rndm_dscrd_tbl_rdata) can be read following a write to this register. for a write access, the buffer manager random discard table write data register (bm_rndm_dscrd_tbl_wdata) should be written before writing this register. register #: 1c09h size: 32 bits bits description type default 31:5 reserved ro - 4 random discard weight table rnw specifies a read (1) or a write (0) command. r/w 0b 3:0 random discard weight table index specifies the buffer usage range that is accessed. there are a total of 16 probability entries. each entry corresponds to a range of the number of buffers used by the ingress port. the ranges are structured to give more resolution towards the lower buffer usage end. r/w 0h bit values buffer usage level 0000 0 to 7 0001 8 to 15 0010 16 to 23 0011 24 to 31 0100 32 to 39 0101 40 to 47 0110 48 to 55 0111 56 to 63 1000 64 to 79 1001 80 to 95 1010 96 to 111 1011 112 to 127 1100 128 to 159 1101 160 to 191 1110 192 to 223 1111 224 to 255 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 371 revision 2.0 (02-14-13) datasheet 13.3.4.11 buffer manager random discard table write data register (bm_rndm_dscrd_tbl_wdata) this register is used to write the random discard weight table. note: the random discard weight table is not initialized upon reset or power-up. if a random discard is enabled, the full table should be initialized by the host. register #: 1c0ah size: 32 bits bits description type default 31:10 reserved ro - 9:0 drop probability these bits specify the discard probability of a packet that has been colored yellow by the ingress metering. the probability is given in 1/1024s. for example, a setting of 1 is one in 1024, or approximately 0.1%. a setting of all ones (1023) is 1023 in 1024, or approximately 99.9%. there are a total of 16 probability entries. each entry corresponds to a range of the number of buffers used by the ingress port, as specified in section 13.3.4.10, "buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd)" . r/w 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 372 smsc lan9313/lan9313i datasheet 13.3.4.12 buffer manager random discard table read data register (bm_rndm_dscrd_tbl_rdata) this register is used to read the random discard weight table. register #: 1c0bh size: 32 bits bits description type default 31:10 reserved ro - 9:0 drop probability these bits specify the discard probability of a packet that has been colored yellow by the ingress metering. the probability is given in 1/1024s. for example, a setting of 1 is one in 1024, or approximately 0.1%. a setting of all ones (1023) is 1023 in 1024, or approximately 99.9%. there are a total of 16 probability entries. each entry corresponds to a range of the number of buffers used by the ingress port, as specified in section 13.3.4.10, "buffer manager random discard table command register (bm_rndm_dscrd_tbl_cmd)" . ro 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 373 revision 2.0 (02-14-13) datasheet 13.3.4.13 buffer manager egress port type register (bm_egrss_port_type) this register is used to configur e the egress vlan tagging rules. see section 6.5.6, "adding, removing, and changing vlan tags," on page 83 for additional details. register #: 1c0ch size: 32 bits bits description type default 31:22 reserved ro - 21 insert tag port 2 when set, untagged packets will have a tag added that contains the default vlan id and priority of the ingress port. the un-tag bit in the vlan table for the default vlan id also needs to be cleared in order for the tag to be inserted. this is only used when the egress port type is set as hybrid. r/w 0b 20 change vlan id port 2 when set, regular tagged packets will have their vlan id overwritten with the default vlan id of the egress port. the change tag bit also needs to be set. the un-tag bit in the vlan table for the incoming vlan id also needs to be cleared, otherwise the tag will be removed instead. priority tagged packets will have vlan id overwritten with the default vlan id of the ingress port independent of this bit. this is only used when the egress port type is set as hybrid. r/w 0b 19 change priority port 2 when set, regular tagged packets will have their priority overwritten with the default priority of the egress port. priority tagged packets will have vlan id overwritten with the default vlan id of the ingress port. for regular tagged packets, the change tag bit also needs to be set. the un-tag bit in the vlan table for the incoming vlan id also needs to be cleared, otherwise the tag would be removed instead. this is only used when the egress port type is set as hybrid. r/w 0b 18 change tag port 2 when set, allows the change tag and change priority bits to affect regular tagged packets. this bit has no affect on priority tagged packets. this is only used when the egress port type is set as hybrid. r/w 0b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 374 smsc lan9313/lan9313i datasheet 17:16 egress port type port 2 these bits set the egress port type which determines the tagging/un-tagging rules. r/w 0b 15:14 reserved ro - 13 insert tag port 1 identical to insert tag port 2 definition above. r/w 0b 12 change vlan id port 1 identical to change vlan id port 2 definition above. r/w 0b 11 change priority port 1 identical to change priority port 2 definition above. r/w 0b 10 change tag port 1 identical to change tag port 2 definition above. r/w 0b 9:8 egress port type port 1 identical to egress port type port 2 definition above. r/w 0b 7:6 reserved ro - 5 insert tag port 0(external mii) identical to insert tag port 2 definition above. r/w 0b 4 change vlan id port 0(external mii) identical to change vlan id port 2 definition above. r/w 0b 3 change priority po rt 0(external mii) identical to change priority port 2 definition above. r/w 0b 2 change tag port 0(external mii) identical to change tag port 2 definition above. r/w 0b 1:0 egress port type po rt 0(external mii) identical to egress port type port 2 definition above. r/w 0b bits description type default bit values egress port type 00 dumb packets from regular ports pass untouched. special tagged packets from the external mii port have their tagged stripped. 01 access tagged packets (including special tagged packets from the external mii port) have their tagged stripped. 10 hybrid supports a mix of tagging, un-tagging and changing tags. see section 6.5.6, "adding, removing, and changing vlan tags," on page 83 for additional details. 11 cpu a special tag is added to indicate the source of the packet. see section 6.5.6, "adding, removing, and changing vlan tags," on page 83 for additional details. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 375 revision 2.0 (02-14-13) datasheet 13.3.4.14 buffer manager port 0 egress rate pr iority queue 0/1 register (bm_egrss_rate_00_01) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c0dh size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 0 priority queue 1 these bits specify the egress data rate for the port 0(external mii) priority queue 1. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 0 priority queue 0 these bits specify the egress data rate for the port 0(external mii) priority queue 0. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 376 smsc lan9313/lan9313i datasheet 13.3.4.15 buffer manager port 0 egress rate pr iority queue 2/3 register (bm_egrss_rate_02_03) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c0eh size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 0 priority queue 3 these bits specify the egress data rate for the port 0(external mii) priority queue 3. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 0 priority queue 2 these bits specify the egress data rate for the port 0(external mii) priority queue 2. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 377 revision 2.0 (02-14-13) datasheet 13.3.4.16 buffer manager port 1 egress rate pr iority queue 0/1 register (bm_egrss_rate_10_11) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c0fh size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 1 priority queue 1 these bits specify the egress data rate for the port 1 priority queue 1. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 1 priority queue 0 these bits specify the egress data rate for the port 1 priority queue 0. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 378 smsc lan9313/lan9313i datasheet 13.3.4.17 buffer manager port 1 egress rate pr iority queue 2/3 register (bm_egrss_rate_12_13) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c10h size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 1 priority queue 3 these bits specify the egress data rate for the port 1 priority queue 3. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 1 priority queue 2 these bits specify the egress data rate for the port 1 priority queue 2. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 379 revision 2.0 (02-14-13) datasheet 13.3.4.18 buffer manager port 2 egress rate pr iority queue 0/1 register (bm_egrss_rate_20_21) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c11h size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 2 priority queue 1 these bits specify the egress data rate for the port 2 priority queue 1. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 2 priority queue 0 these bits specify the egress data rate for the port 2 priority queue 0. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 380 smsc lan9313/lan9313i datasheet 13.3.4.19 buffer manager port 2 egress rate pr iority queue 2/3 register (bm_egrss_rate_22_23) this register, along with the buffer manager configuration register (bm_cfg) , is used to configure the egress rate pacing. register #: 1c12h size: 32 bits bits description type default 31:26 reserved ro - 25:13 egress rate port 2 priority queue 3 these bits specify the egress data rate for the port 2 priority queue 3. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h 12:0 egress rate port 2 priority queue 2 these bits specify the egress data rate for the port 2 priority queue 2. the rate is specified in time per byte. the time is this value plus 1 times 20ns. r/w 00000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 381 revision 2.0 (02-14-13) datasheet 13.3.4.20 buffer manager port 0 default vlan id and priority register (bm_vlan_mii) this register is used to specify the default vlan id and priority of port 0(external mii). register #: 1c13h size: 32 bits bits description type default 31:15 reserved ro - 14:12 default priority these bits specify the default priority that is used when a tag is inserted or changed on egress. r/w 000b 11:0 default vlan id these bits specify the default that is used when a tag is inserted or changed on egress. r/w 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 382 smsc lan9313/lan9313i datasheet 13.3.4.21 buffer manager port 1 default vlan id and priority register (bm_vlan_1) this register is used to specify the default vlan id and priority of port 1. register #: 1c14h size: 32 bits bits description type default 31:15 reserved ro - 14:12 default priority these bits specify the default priority that is used when a tag is inserted or changed on egress. r/w 000b 11:0 default vlan id these bits specify the default that is used when a tag is inserted or changed on egress. r/w 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 383 revision 2.0 (02-14-13) datasheet 13.3.4.22 buffer manager port 2 default vlan id and priority register (bm_vlan_2) this register is used to specify the default vlan id and priority of port 2. register #: 1c15h size: 32 bits bits description type default 31:15 reserved ro - 14:12 default priority these bits specify the default priority that is used when a tag is inserted or changed on egress. r/w 000b 11:0 default vlan id these bits specify the default that is used when a tag is inserted or changed on egress. r/w 000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 384 smsc lan9313/lan9313i datasheet 13.3.4.23 buffer manager port 0 ingress rate drop count register (bm_rate_drp_cnt_src_mii) this register counts the number of packets received on port 0(external mii) that were dropped by the buffer manager due to ingress rate limit discarding (red and random yellow dropping). register #: 1c16h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 0(external mii) and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 385 revision 2.0 (02-14-13) datasheet 13.3.4.24 buffer manager port 1 ingress rate drop count register (bm_rate_drp_cnt_src_1) this register counts the number of packets received on port 1 that were dropped by the buffer manager due to ingress rate limit discarding (red and random yellow dropping). register #: 1c17h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 1 and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 386 smsc lan9313/lan9313i datasheet 13.3.4.25 buffer manager port 2 ingress rate drop count register (bm_rate_drp_cnt_src_2) this register counts the number of packets received on port 2 that were dropped by the buffer manager due to ingress rate limit discarding (red and random yellow dropping). register #: 1c18h size: 32 bits bits description type default 31:0 dropped count these bits count the number of dropped packets received on port 2 and is cleared when read. note: this counter will stop at its maximum value of ffff_ffffh. minimum rollover time at 100mbps is approximately 481 hours. rc 00000000h downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 387 revision 2.0 (02-14-13) datasheet 13.3.4.26 buffer manager interrupt mask register (bm_imr) this register contains the buffer manager inte rrupt mask, which masks the interrupts in the buffer manager interrupt pending register (bm_ipr) . all buffer manager interrupts are masked by setting the interrupt mask bit. clearing this bit will unmask the interrupts. refer to chapter 5, "system interrupts," on page 55 for more information. register #: 1c20h size: 32 bits bits description type default 31:1 reserved ro - 0 interrupt mask when set, this bit masks interrupts from the buffer manager. the status bits in the buffer manager interrupt pending register (bm_ipr) are not affected. r/w 1b downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 388 smsc lan9313/lan9313i datasheet 13.3.4.27 buffer manager interrupt pending register (bm_ipr) this register contains the buffer manager interrupt status. the status is double buffered. all interrupts in this register may be masked via the buffer manager interrupt mask register (bm_imr) register. refer to chapter 5, "system interrupts," on page 55 for more information. register #: 1c21h size: 32 bits bits description type default 31:14 reserved ro - 13:10 drop reason b when bit 7 is set, these bits indicate the reason a packet was dropped per the table below: rc 0h 9:8 source port b when bit 7 is set, these bits indicate the source port on which the packet was dropped. 00 = port 0 01 = port 1 10 = port 2 11 = reserved rc 00b 7 status b pending when set, bits 13:8 are valid. rc 0b bit values description 0000 the destination address was not in the alr table (unknown or broadcast), and the broadcast buffer level was exceeded. 0001 drop on red was set and the packet was colored red. 0010 there were no buffers available. 0011 there were no memory descriptors available. 0100 the destination address was not in the alr table (unknown or broadcast) and there were no valid destination ports. 0101 the packet had a receive error and was >64 bytes 0110 the buffer drop level was exceeded. 0111 reserved 1000 reserved 1001 drop on yellow was set, the packet was colored yellow and was randomly selected to be dropped. 1010 reserved 1011 reserved 1100 reserved 1101 reserved 1110 reserved 1111 reserved downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 389 revision 2.0 (02-14-13) datasheet 6:3 drop reason a when bit 0 is set, these bits indicate the reason a packet was dropped. see the drop reason b description above for definitions of each value of this field. rc 0h 2:1 source port a when bit 0 is set, these bits indicate the source port on which the packet was dropped. 00 = port 0 01 = port 1 10 = port 2 11 = reserved rc 00b 0 set a valid when set, bits 6:1 are valid. rc 0b bits description type default downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 390 smsc lan9313/lan9313i datasheet chapter 14 operational characteristics 14.1 absolute maximum ratings* supply voltage (vdd33a1, vdd33a2, vdd33bias, vdd33io) ( note 14.1 ) . . . . . . . . . . . 0v to +3.6v positive voltage on signal pins, with respect to ground ( note 14.2 ) . . . . . . . . . . . . . . . . . . . . . . . . . +6v negative voltage on signal pins, with respect to ground ( note 14.3 ) . . . . . . . . . . . . . . . . . . . . . . . -0.5v positive voltage on xi, with respect to ground. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + 4.6v positive voltage on xo, with respect to ground. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +2. 5v ambient operating temperature in still air (t a ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . note 14.4 storage temperature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .-55 o c to +150 o c lead temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . refer to jedec spec . j-std-020 hbm esd performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..+/- 5kv note 14.1 when powering this device from laboratory or system power supplies, it is important that the absolute maximum ratings not be exceeded or device failure can result. some power supplies exhibit voltage spikes on their outputs when ac power is switched on or off. in addition, voltage transients on the ac power line may appear on the dc output. if this possibility exists, it is suggeste d that a clamp circuit be used. note 14.2 this rating does not apply to the following pins: xi, xo, exres. note 14.3 this rating does not apply to the following pins: exres. note 14.4 0 o c to +70 o c for commercial vers ion (lan9313), -40 o c to +85 o c for industrial version (lan9313i) *stresses exceeding those listed in this section could cause permanent damage to the device. this is a stress rating only. exposure to absolute maximum rating conditions for extended periods may affect device reliability. functional operation of the device at any condition exceeding those indicated in section 14.2, "operating conditions**" , section 14.4, "dc specifications" , or any other applicable section of this specification is not implied. note, device signals are not 5 volt tolerant. 14.2 operating conditions** supply voltage (vdd33a1, vdd33a2, vdd33bias, vdd33io). . . . . . . . . . . . . . . . . +3.3v +/- 300 mv ambient operating temperature in still air (t a ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . note 14.4 **proper operation of the lan9313/lan9313i is guaranteed only within the ranges specified in this section. downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 391 revision 2.0 (02-14-13) datasheet 14.3 power consumption this section details the power consumption of the lan9313/lan9313i. power consumption values are provided for both the device-only, and for the device plus the ethernet components on ports 1 and 2. note 14.5 over the conditions specified in section 14.2, "operating conditions**" . note: power dissipation is determined by operating frequency, temperature, and supply voltage, as well as external source/s ink current requirements. table 14.1 supply and curre nt (10base-t full-duplex) parameter typical (@ 3.3v) maximum (@ 3.6v) unit supply current at 3.3v (vdd33a1, vdd33a2, vdd33bias, vdd33io) 135 155 ma power dissipation (device only) 445 565 mw power dissipation (device and ethernet components) 1140 1330 mw ambient operating temperature in still air (t a )2 5 note 14.5 o c table 14.2 supply and curr ent (100base-tx full-duplex) parameter typical (@ 3.3v) maximum (@ 3.6v) unit supply current (vdd33a1, vdd33a2, vdd33bias, vdd33io) 230 270 ma power dissipation (device only) 760 980 mw power dissipation (device and ethernet components) 1045 1295 mw ambient operating temperature in still air (t a )2 5 note 14.5 o c downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 392 smsc lan9313/lan9313i datasheet 14.4 dc specifications note 14.6 this specification applies to all is type inputs and tri-stated bi-directional pins. internal pull- down and pull-up resistors add +/- 50ua per-pin (typical). note 14.7 xi can optionally be driven from a 25mhz single-ended clock oscillator. table 14.3 i/o buffer characteristics parameter symbol min typ max units notes is type input buffer low input level high input level negative-going threshold positive-going threshold schmitttrigger hysteresis (v iht - v ilt ) input leakage input capacitance v ili v ihi v ilt v iht v hys i in c in -0.3 1.01 1.39 345 -10 1.18 1.6 420 3.6 1.35 1.8 485 10 3 vv v v mv ua pf schmitt trigger schmitt trigger note 14.6 o8 type buffers low output level high output level v ol v oh vdd33io - 0.4 0.4 v v i ol = 8ma i oh = -8ma od8 type buffer low output level v ol 0.4 v i ol = 8ma o12 type buffer low output level high output level v ol v oh vdd33io - 0.4 0.4 v v i ol = 12ma i oh = -12ma od12 type buffer low output level v ol 0.4 v i ol = 12ma iclk type buffer (xi input) low input level high input level v ili v ihi -0.3 1.4 0.5 3.6 vv note 14.7 table 14.4 100base-tx transceiver characteristics parameter symbol min typ max units notes peak differential output voltage high v pph 950 - 1050 mvpk note 14.8 peak differential output voltage low v ppl -950 - -1050 mvpk note 14.8 signal amplitude symmetry v ss 98 - 102 % note 14.8 signal rise and fall time t rf 3.0 - 5.0 ns note 14.8 rise and fall symmetry t rfs --0 . 5n s note 14.8 duty cycle distortion d cd 35 50 65 % note 14.9 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 393 revision 2.0 (02-14-13) datasheet note 14.8 measured at line side of transformer, line replaced by 100 (+/- 1%) resistor. note 14.9 offset from 16ns pulse width at 50% of pulse peak. note 14.10 measured differentially. note 14.11 min/max voltages guaranteed as measured with 100 resistive load. 14.5 ac specifications this section details the various ac timing specifications of the lan9313/lan9313i. note: the i 2 c timing adheres to the philips i 2 c-bus specification . refer to the philips i 2 c-bus specification for detailed i 2 c timing information. note: the mii/smi timing adheres to the ieee 802.3 spec ification. refer to the ieee 802.3 specification for detailed mii timing information. 14.5.1 equivalent test load output timing specifications assume the 25pf equivalent test load illustrated in figure 14.1 below. overshoot and undershoot v os --5% jitter 1.4 ns note 14.10 table 14.5 10base-t transceiver characteristics parameter symbol min typ max units notes transmitter peak differential output voltage v out 2.2 2.5 2.8 v note 14.11 receiver differential squelch threshold v ds 300 420 585 mv figure 14.1 output equivalent test load table 14.4 100base-tx transceiver characteristics (continued) parameter symbol min typ max units notes 25 pf output downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 394 smsc lan9313/lan9313i datasheet 14.5.2 reset and configuration strap timing this diagram illustrates the nrst pin timing requirements and its relation to the configuration strap pins and output drive. assertion of nrst is not a requirement. however, if used, it must be asserted for the minimum period specified. please refer to section 4.2, "resets," on page 43 for additional information. note: device configuration straps are latched as a result of nrst assertion. refer to section 4.2.4, "configuration straps," on page 47 for details. figure 14.2 nrst reset pin timing table 14.6 nrst reset pin timing values symbol description min typ max units t rstia nrst input assertion time 200 s t css configuration strap pins setup to nrst deassertion 200 ns t csh configuration strap pins hold after nrst deassertion 10 ns t odad output drive after deassertion 30 ns t css nrst configuration strap pins t rstia t csh output drive t odad downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 395 revision 2.0 (02-14-13) datasheet 14.5.3 power-on configurat ion strap valid timing this diagram illustrates the configuration strap valid timing requirements in relation to power-on . in order for valid configuration strap values to be read at power-on, the following t iming requirements must be met. note: configuration straps must only be pulled high or low. configuration straps must not be driven as inputs. note: device configuration straps ar e also latched as a result of nrst assertion. refer to section 14.5.2, "reset and configuration strap timing," on page 394 and section 4.2.4, "configuration straps," on page 47 for additional details. figure 14.3 power-on configur ation strap latching timing table 14.7 power-on configurat ion strap latching timing values symbol description min typ max units t cfg configuration strap valid time 15 ms vdd33io configuration straps t cfg 2.0v downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 396 smsc lan9313/lan9313i datasheet 14.5.4 microwire timing this section specifies the microwire eeprom in terface timing requirements. please refer to section 8.2.3, "microwire eeprom," on page 112 for a functional description of this serial interface. figure 14.4 microwire timing table 14.8 microwire timing values symbol description min typ max units t ckcyc eeclk cycle time 1110 1130 ns t ckh eeclk high time 550 570 ns t ckl eeclk low time 550 570 ns t cshckh eecs high before rising edge of eeclk 1070 ns t cklcsl eeclk falling edge to eecs low 30 ns t dvckh eedo valid before rising edge of eeclk 550 ns t ckhdis eedo disable after rising edge of eeclk 550 ns t dsckh eedi setup to rising edge of eeclk 90 ns t dhckh eedi hold after rising edge of eeclk 0 ns t ckldis eeclk low to eedo data disable 580 ns t cshdv eedi valid after eecs high (verify) 600 ns t dhcsl eedi hold after eecs low (verify) 0 ns t csl eecs low 1070 ns eeclk eedo eedi eecs t ckldis t cshckh eedi (verify) t ckh t ckl t ckcyc t cklcsl t csl t dvckh t ckhdis t dsckh t dhckh t dhcsl t cshdv downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 397 revision 2.0 (02-14-13) datasheet 14.5.5 spi slave timing this section specifies the spi slave interface timing requirements. please refer to section 8.4, "spi slave operation," on page 122 for a functional description of this serial interface. figure 14.5 spi slave timing table 14.9 spi slave timing values symbol description min typ max units f sck sck clock frequency 10 mhz t high sck high time 40 ns t low sck low time 40 ns t nscss nscs setup time 50 ns t nscsh nscs hold time 80 ns t su data input setup time 10 ns t hd data input hold time 20 ns t v data output valid time 40 ns t ho data output hold time 0 ns t dis data output disable time 40 ns sck si so nscs t nscss t high t low t dis t nscsh t su t hd t ho t v downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 398 smsc lan9313/lan9313i datasheet 14.6 clock circuit the lan9313/lan9313i can accept either a 25mhz crystal (preferred) or a 25mhz single-ended clock oscillator (+/- 50ppm) input. if the single-ended cl ock oscillator method is implemented, xo should be left unconnected and xi should be driven with a nominal 0-3.3v clock signal. the input clock duty cycle is 40% minimum, 50% typical and 60% maximum. it is recommended that a crystal utilizing matchi ng parallel load capacitors be used for the crystal input/output signals (xi/xo). see table 14.10 for crystal specifications. note 14.12 the maximum allowable values for frequency tolerance and frequency stability are application dependant. since any particular application must meet the ieee +/-50 ppm total ppm budget, the combination of these two values must be approximately +/-45 ppm (allowing for aging). note 14.13 frequency deviation over time is also referred to as aging. note 14.14 the total deviation for the transmitter clock frequency is specified by ieee 802.3 as +/- 50 ppm. note 14.15 this number includes the pad, the bond wire and the lead frame. pcb capacitance is not included in this value. the xo/xi pin and pcb capacitance values are required to accurately calculate the value of the two external load capacitors. these two external load capacitors determine the accuracy of the 25.000 mhz frequency. note 14.16 0 o c for commercial version (lan9313), -40 o c for industrial version (lan9313i) note 14.17 +70 o c for commercial vers ion (lan9313), +85 o c for industrial version (lan9313i) table 14.10 lan9313/lan9313i crystal specifications parameter symbol min nom max units notes crystal cut at, typ crystal oscillation mode fundamental mode crystal calibration mode parallel resonant mode frequency f fund - 25.000 - mhz frequency tolerance @ 25 o cf tol - - +/-50 ppm note 14.12 frequency stability over temp f temp - - +/-50 ppm note 14.12 frequency deviation over time f age - +/-3 to 5 - ppm note 14.13 total allowable ppm budget - - +/-50 ppm note 14.14 shunt capacitance c o -7 t y p-p f load capacitance c l - 20 typ - pf drive level p w 300 - - uw equivalent series resistance r 1 --5 0 o h m operating temperature range note 14.16 - note 14.17 o c n/a xi pin capacitance - 3 typ - pf note 14.15 n/a xo pin capacitance - 3 typ - pf note 14.15 downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 399 revision 2.0 (02-14-13) datasheet chapter 15 package outlines 15.1 128-vtqfp package outline figure 15.1 128-vtqfp package definition table 15.1 128-vtqfp dimensions min nominal max remarks a - - 1.20 overall package height a1 0.05 - 0.15 standoff a2 0.95 1.00 1.05 body thickness d/e 15.80 16.00 16.20 x/y span d1/e1 13.80 14.00 14.20 x/y plastic body size l 0.45 0.60 0.75 lead foot length b 0.13 0.18 0.23 lead width c 0.09 - 0.20 lead foot thickness e 0.40 bsc lead pitch ddd 0.00 - 0.07 true position spread ccc - - 0.08 coplanarity downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 400 smsc lan9313/lan9313i datasheet notes: 1. all dimensions are in milli meters unless otherwise noted. 2. dimensions b & c apply to the flat section of the l ead foot between 0.10 and 0.25mm from the lead tip. the base metal is exposed at the lead tip. 3. dimensions d1 and e1 do not include mold protrusi ons. maximum allowed protrusion is 0.25mm per side. d1 and e1 are maximum plastic body size dimensions including mold mismatch. 4. the pin 1 identifier may vary, but is always located within the zone indicated . figure 15.2 128-vtqfp recommended pcb land pattern downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 401 revision 2.0 (02-14-13) datasheet 15.2 128-xvtqfp package outline figure 15.3 128-xvtqfp package definition downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 402 smsc lan9313/lan9313i datasheet notes: 1. all dimensions are in milli meters unless otherwise noted. 2. dimensions b & c apply to the flat section of the l ead foot between 0.10 and 0.25mm from the lead tip. the base metal is exposed at the lead tip. 3. dimensions d1 and e1 do not include mold protrusi ons. maximum allowed protrusion is 0.25mm per side. d1 and e1 are maximum plastic body size dimensions including mold mismatch. 4. dimensions d2 and e2 represent the size of the ex posed pad. the exposed pad shall be coplanar with the bottom of the package within 0.05mm. 5. the pin 1 identifier may vary, but is always located within the zone indicated . table 15.2 128-xvtqfp dimensions min nominal max remarks a - - 1.20 overall package height a1 0.05 - 0.15 standoff a2 0.95 1.00 1.05 body thickness d/e 15.80 16.00 16.20 x/y span d1/e1 13.80 14.00 14.20 x/y plastic body size d2/e2 4.85 5.00 5.15 x/y exposed pad size l 0.45 0.60 0.75 lead foot length b 0.13 0.18 0.23 lead width c 0.09 - 0.20 lead foot thickness e 0.40 bsc lead pitch ddd 0.00 - 0.07 true position spread ccc - - 0.08 coplanarity figure 15.4 128-xvtqfp reco mmended pcb land pattern downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet smsc lan9313/lan9313i 403 revision 2.0 (02-14-13) datasheet chapter 16 datasheet revision history table 16.1 customer revision history revision level & date secti on/figure/entr y correction rev. 2.0 (02-14-13) chapter 3, "pin description and configuration," on page 27 changed refer to the lan9313/lan9313i application note for additional connection information. to refer to the lan9313/lan9313i reference schematic for additional connection information. in the vdd18tx1, vdd18tx2, vdd18pll, vdd33io, v dd18core, vdd33a1, vdd33a2, and vdd33bias pin descriptions. rev. 1.9 (03-13-12) order codes updated ordering codes to include tape and reel options. rev. 1.8 (07-07-11) figure 15.3 128-xvtqfp package definition on page 401 , table 15.2, 128- xvtqfp dimensions, on page 402 , and figure 15.4 128-xvtqfp recommended pcb land pattern on page 402 updated 128-xvtqfp package dimensions and figures. rev. 1.7 (06-29-10) table 3.6, eeprom pins, on page 38 added note to ee_ sda and ee_scl pin descriptions stating if i 2 c is selected, an external pull-up is requ ired when using an eeprom and is recommended if no eeprom is attached. table 3.6, eeprom pins, on page 38 added note to eedo/eeprom_type pin descriptions stating when not using a microwire or i 2 c eeprom, an external pull-down resistor is recommended on this pin. section 13.1.7.4, "virtual phy identification lsb register (vphy_id_lsb)," on page 219 and section 13.2.2.4, "port x phy identification lsb register (phy_id_lsb_x)," on page 242 clarified default values using binary. section 13.3.2.23, "port x mac transmit configuration register (mac_tx_cfg_x)," on page 294 added note to ifg config field description: note: ifg config values less than 15 are unsupported. table 6.1, switch fabric flow control enable logic, on page 64 corrected rightmost colu mn title to tx flow control enable figure 14.2 nrst reset pin timing on page 394 updated figure shading. rev. 1.6 (08-19-09) all standard smsc formatting applied. rev. 1.5 (10-28-08) section 13.1.3.1, "eeprom command register (e2p_cmd)," on page 164 corrected cfg_loaded bit type from ro to r/wc downloaded from: http:///
three port 10/100 managed ethernet switch with mii datasheet revision 2.0 (02-14-13) 404 smsc lan9313/lan9313i datasheet section 14.6, "clock circuit," on page 398 changed max esr value from 30 to 50 ohms and corrected typos in operating temerpature range. all fixed various typos rev. 1.3 (07-03-08) port x phy special control/status register (phy_special_control _status_x) on page 256 updated reserved bits 11:5 definition to reserved - write as 0000010b, ignore on read, changed default to 0000010b, and made field r/w. port x phy auto-negotiation advertisement register (phy_an_adv_x) on page 243 bits 15 and 9 made reserved. section 14.6, "clock circuit," on page 398 changed minimum drive level from 0.5mw to 300uw table 16.1 customer revision history (continued) revision level & date secti on/figure/entr y correction downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of LAN9313-NZW

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X